Google App Engine's (GAE) Python Software Development Kit (SDK) for Windows includes a convenient installation package and launcher utility for managing your web applications. The Linux version lacks these features, so when I ditched Windows in favor of Ubuntu 12.04 I was a bit disoriented at first. I'm pleased to report that despite the lack of hand holding, the Linux platform is better suited for GAE Python development. Follow these steps and you will be up and running in five minutes or less.
First, I assume you already have Ubuntu 12.04 up and running, so open a new terminal with
Ctrl-Alt t and perform the following tasks:
- navigate to your home directory
- create a
- move into
- download Google App Engine 1.7.1
- unzip the file
- delete the .zip archive
cd ~ mkdir google_projects cd google_projects wget -O gae.zip http://googleappengine.googlecode.com/files/google_appengine_1.7.1.zip unzip gae.zip rm gae.zip
Next, create a test project and start the development server. We will use Google's
google_appengineand rename it
cp -r google_appengine/new_project_template testapp python google_appengine/dev_appserver.py testapp
- open up your web browser to
http://localhost:8080to be greated with "Hello world!".
- stop the server with
Keep Reading For Optional Configurations
Luanch Your App on a Specific Port
Sometimes you need to run
dev_appserver.py on a specific port.
python google_appengine/dev_appserver.py --port=1234 testapp
Update Your System Path
Adding Google App Engine to your systems path saves you time. It's really simple too.
Scroll all the way to the bottom of the file and add these two lines.
# Path for Google App Engine PATH=$PATH:/home/your_user_name/your_project_folder/google_appengine/
*be sure to replace
your_project_folder with the correct values.
- For the changes to take affect you must close and reopen your terminal window
- Start your Google App Engine app like this:
*Did you notice that you didn't have to type out the path to
dev_appserver.py? That means your path is working.
Go back to
http://localhost:8080 to see "Hello world!" again.
Read The Python Development Server's Official Doc
GAE's official docs on the Python development server are pretty good and are definately worth a look.
Have a question? Something doesn't work?
Leave a comment and I promise to respond quickly.