Setup Google App Engine 1.7.1 on Ubuntu 12.04


01 September, 2012 by John W. O'Grady in , with Comments

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 google_projects folder
  • move into google_projects
  • 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 new_project_template for testapp

  • copy new_project_template from google_appengine and rename it testapp in your google_projects directory
  • start dev_appserver.py
cp -r google_appengine/new_project_template testapp
python google_appengine/dev_appserver.py testapp
  • open up your web browser to http://localhost:8080 to be greated with "Hello world!".
  • stop the server with Ctrl-c.

That's it!

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.

pico ~/.bashrc

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_user_name and your_project_folder with the correct values.

  • Ctrl-o to save
  • Ctrl-x to exit
  • For the changes to take affect you must close and reopen your terminal window
  • Start your Google App Engine app like this:
dev_appserver.py google_projects/testapp

*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.

comments powered by Disqus