[Fixed]-Django on Google App Engine


I spent some time trying to answer the same question… it seems to me that the most difficult thing to transfer to GAE are django’s models… in the sense that they require various modifications and rethinking, mainly because GAE’s backend is not a standard relational DB, but google’s BigTable. I found a nice intro to this here:


Anyways, it’s worth downloading one of those ‘patches’ and have a go with it!

For me the best solution is the ‘app-engine-patch‘. I downloaded the sample project and it worked straightaway! (Mind that you need to have GAE’s SDK installed separately) A killer-feature for me is the fact that the django-admin and many other classic django functionalities have been ported too!!!


The documentation is still quite minimal in my opinion, but it’s good enough to get you going. It’ll help you to skim though the official GAE docs though!


Just Yesterday (depending on your time zone), Google released a new SDK for Python on Appengine that supports django 1.0 out of the box.



You need to use django-nonrel (source).

You will still find loads of issues:

  • Many2Many relations not supported
  • Fake joins increase number of queries
  • App Engine doesn’t allow any python lib with socket or C dependencies (sentry, lxml…)

You can try to get early access to CloudSQL.

Otherwise you are not constraint to use App Engine, you can think about using:

Cheaper and more control with support requirement files like pip.



31.01.2012, Google released App Engine 1.6.2 that supports Django out-of-the box.


App Engine includes version 0.96 of Django out-of-the-box, but it is quite crippled.

App Engine Helper and app-engine-patch supposedly fix this problem to some degree, but I haven’t tried either myself.



The amount of pain depends on how much existing code you want to reuse. Unfortunately because of the Datastore does not support SQL, you often cannot just take any django-pluggable app and use it on your GAE project.

App-engine-patch http://code.google.com/p/app-engine-patch/ looks to be ahead of the other django helpers in bringing the standard applications (Sites, ContentTypes, Flatpages) over to GAE. I have used app-engine-patch on several gae projects, and once you understand how to port a django-sql model to a django-gae model and converting sql to datastore queries things can be done very quickly – but there is always a learning curve.

appengine-helper tries to bridge the Datastore gap by providing a model so you don’t have to change your model superclasses, but I’ve found that you end up having to change ManyToMany relationships and any sql anyway, so the advantage ends up being minimal. ae-patch has a roadmap to try to provide an ae-datastore backend, but it probably won’t happen for a while.



Google has now launched their Cloud SQL storage. That is actually MySQL 5.5 in the cloud. IMO that’s a very nice way to migrate your Django app into the cloud. They have a free trial up to June 1, 2013.

If you need some tips how to set up your Django project for Appengine and Cloud SQL I’ve written a tutorial for that.

Leave a comment