Tuesday, July 7, 2009

Setting up a Python Google App Engine development environment

I am setting a development environment for working on Google App Engine projects. I have a freshly minted Windows 7 RC virtual machine cloned from a base image and made individual. Having a separate development environment on a virtual machine for working with Google App Engine (or anything similiar) makes a lot of sense. Especially since the Google App Engine SDK is tied to a specific python version.

What do you need to do to set up the development environment (at least in MS Windows)?

  1. Install Python 2.5.4 from the Python Website. I am not sure whether Google intends to support later versions but 2.5 is definitely not the latest, so be careful to install the correct version. I accept the default program folder of C:\python25, if only because I can vaguely recall issues with paths with spaces. I also install for all users.
  2. Make sure the python interpreter is in the system path. You should be able to open a command prompt window and type 'python' from anywhere on the file system and have the interpreter found. Add the main python folder (C:\python25 in my case) and the binaries folder (C:\python25\bin) to your path.
  3. Your file associations (.py --> python) should already be set by the installer.
  4. Install the App Engine SDK for Python from the App Engine Downloads page. There is nothing special to select during the install.
  5. The installer for the App Engine SDK python should have put the scripts on the system path. If you open a (new) command prompt window you should be able to verify this by typing dev_appserver.py with no arguments.
UPDATE 15th July 2009: You should also consider installing PIL as discussed in this post.

You are now ready to rock and roll.... as long you do not mind working in notepad or notepad++.
I do not have strong opinions about an IDE at this early stage, and I am interested in hearing input. Google have a Google App Engine Eclipse Plugin but this is for Java only.

Eclipse already has an excellent plugin for Python called Pydev. However Pydev was only recently acquired by Aptana. You can find some excellent notes for installing and configuring only Pydev for Google App Engine on Google's own help page, thanks to the contributions of Joscha Feth.

However I am going to explore going down a different path. Since Google App Engine (or Django or other Python web projects) still requires static assets like Javascript and CSS in addition to HTML templates, and since Aptana is the leader in these features for Eclipse, I am going to try my luck with installing Aptana studio. I will let you know how I go.

What is everyone else using?

I would also like to discover a lightweight alternative to Eclipse editing for my Netbook (Eclipse is a beast and I am not sure my space- and processor-constrained Netbook would cope). If I find I will post it here.

No comments:

Post a Comment