views:

1378

answers:

4

How much of a pain is it to run a Django App on App Engine? Also, does the Datastore work as-is with Django?

A: 

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.

http://code.google.com/appengine/articles/appengine_helper_for_django.html http://code.google.com/appengine/articles/app-engine-patch.html

Jonathan Maddison
+6  A: 

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:

http://www.youtube.com/watch?v=rRCx9e38yr8

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!!!

http://code.google.com/p/app-engine-patch/

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!

magicrebirth
I found the app engine patch to be a PIA. It always looks for some strange python modules, oftentimes returns wierd errors, and functions completely different than django runserver.
drozzy
A: 

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.

dar
+7  A: 

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.

Lakshman Prasad
Thanks for the pointer! I am also pretty excited about the task queues!
Jake