NOTE: THE PROCESS DESCRIBED BELOW IS NOT RECOMMENDED. THE GOOGLE APP ENGINE HELPER FOR DJANGO IS NOW DEPRECATED, PER THE APPENGINE IRC. Use app-engine-patch instead. There is also something called Django-nonrel for integrating Django with non-relational databases. My impression is that this is deprecated as well. Therefore, I’ll be looking into the app-engine-patch for Django.
This was a painful process for two reasons:
a) The Debian pthon-antlr package is only version 2.7.7 and the Google App Engine appears to depend on 3.x. This didn’t show up until I installed the Google App Engine Helper, but the issue appeared to be in the App Engine code itself.
Fix: Go to the ANTLR.org web site python runtime download page and download the most recent version. The page was a little hard to find. You can just go here.
Once I downloaded the file, I installed it the usual way:
sudo python2.5 ./setup.py install
Note: I had to use python2.5 or the install failed. Python2.6 is the “native” python on my system, but python2.5 is the version that Google App Engine recommends (requires?).
b) I had to install the python-ipaddr package.
c) A current version of Django needs to be in the project directory as a zip file. You have to build the zip file. Directions on how to do this are here. I created a file called zipit based on the instructions; the content of the file is included below.
d) The next missing package was “fancy_urllib”. The package is installed with the Google App Engine SDK under (on my machine) /usr/local/lib/google_app_engine/lib/fancy_urllib. Information on the issue is available here.
When I look at the /usr/local/lib/google_appengine/lib directory I see all the “missing” modules. Even after adding them to my PYTHONPATH they are not seen by manage.py.
Well, adding the path to the PYTHONPATH environment variable didn’t help. I looked into the directory and there was nothing there but an __init__.py. Nothing to import?? However, there is another subdirectory lower also called fancy_urllib. That directory __init__.py contains the contents of the module as I found it defined here. I modified my PYTHONPATH to include fancy_urllib; didn’t work. I created a file called “fancy_urllib.py” in the fancy_urllib directory of the appengine sdk; that didn’t work. Finally I just created a new file in my project directory called “fancy_urllib.py” and placed the contents from the web site into it, and that worked.
Then when I loaded http://localhost:8000 the page showed a bunch of errors. Basically, the yaml module was not found. I went ahead (because I was sick of the process) and just copied it from the appengine sdk into the project directory. Then the errors went away and I got a page saying “success”.
There is something that I didn’t understand about the setup. I have to look back over the install another day. However, the PYTHONPATH does not seem to be used within the server’s runtime environment. Need to do some research.
Finally after all this, the command:
python2.5 ./manage.py runserver
yay?? Maybe… painful.
The zipit file:
zip -r django.zip django/__init__.py django/bin django/core \
django/db django/dispatch django/forms \
django/http django/middleware django/shortcuts \
django/template django/templatetags \
django/test django/utils django/views
zip -r django.zip django/conf -x ‘django/conf/locale/*’
zip -r django.zip django/contrib/__init__.py \