Running Google App Engine Helper trunk with Django trunk (zipimport)

Dan Sanderson has a good article on Google Code on Using Django 1.0 on App Engine with Zipimport, however it misses two steps in preparing the file if you want to use the latest Django trunk with the latest Google App Engine Helper.

To create a new Django application for Google App Engine using Google App Engine Helper, start by exporting the latest Google App Engine Helper:

svn export ~/myapp

To create a file to use with the latest Google App Engine:

  1. Export the latest Django trunk
    svn export django
  2. Follow steps #2 and #3 in Dan's instructions under the "Archiving Django 1.0" section of his article
  3. Add contrib/auth:
    zip -r django/contrib/ \
  4. Add contrib/sessions:
    zip -r django/contrib/ \
  5. Copy the file into the root folder of your new app:
    cp ~/myapp
  6. Uncomment the sessions middleware or auth middleware lines in file in your app so that it looks like:
      #    'django.middleware.doc.XViewMiddleware',

That's it! To test it out:

./ runserver

Hit http://localhost:8000/ and you should see the default Django welcome page.

Update: Don't make the mistake of adding django.contrib.auth or django.contrib.sessions to your INSTALLED_APPS, even though you are including those apps in the file. If you do, ./ runserver will work but ./ shell and ./ flush will return errors.