views:

708

answers:

4

We are planning a web application to build on Google's App Engine platform. Is it good to use the Django 1.1 framework to develop Google App Engine applications?

If not, could you please suggest me the best option available, which has good tutorials and learning resource?

+3  A: 

Yes, Django 1.1 is well-supported on Google App Engine. You'll need to do your own installation thereof locally, to enable it in the GAE SDK -- but it's already there for you on the App Engine production servers, see the docs -- just do

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

from google.appengine.dist import use_library
use_library('django', '1.1')

Edit: Django is by far the leading web app framework for Python, and its popularity is surely well-deserved. However, personally, I use it only when I "have to" (mostly to get collaborators and make them comfy on a project's technology stack) -- maybe because what I tend to develop server-side are more "web services/apps" than "sites" (the UI part I'd rather leave to the browser, with Dojo, jQuery, or Google Closure!-), I find Django too "heavy" for my tastes. I'd rather have Werkzeug, or tipfy -- the latest and greatest super-light Wekzeug-based App Engine - specialized framework!-) -- I love e.g. tipfy's ability to use Jinja2 and/or Mako in lieu of Django's templates, the simple and flexible authentication and session schemes, and the debugger -- in addition to all the luscious, light-weight flexibility of Werkzeug and Webapp. But, hey, that's a very subjective opinion of mine!-)

Alex Martelli
Thank you very much Alex. Any idea how to setup django 1.1 in development environment?
Software Enthusiastic
@Software, just install Django 1.1 on your local Python 2.5 (the version GAE's SDK uses) and the above snippet (which works fine on production GAE) should work on your local SDK too.
Alex Martelli
Thank you very much Alex...
Software Enthusiastic
A word of warning here, I had a load of problems using the built in 1.0 Django. By far the most annoying were random "Could import name signals" exceptions that I could not fix. When I started using my own zipped django, everything went smooth.
Koen Bok
A: 

You should check out appenginepatch (http://code.google.com/p/app-engine-patch/) and django-nonrel (http://www.allbuttonspressed.com/projects/django-nonrel)

I'm using appenginepatch for my website (beta.fiddme.com) and its awesome (there's a full post on the technology stack we're using at http://www.developerzen.com/2009/10/29/building-an-iphone-application/)

Eran Kampf
Thanks @Eran, App Engine Patch is no loger active. And django-nonrel doesnt have good documentation... Would you still suggest me that?
Software Enthusiastic
I'm currently using AppEnginePatch even though its not currently in development. It works great and I havent encountered any bugs in the few monthes Im using it...I assume I will have to convert at some point but I dont see any need in the neartime future.The way I see it, without appenginepatch which makes the django-admin working on GAE, there's no real advantage for using django over one of the other lightweight frameworks (ok there's the templating support etc. but I guess other frameworks have just-as-good solutions)
Eran Kampf
A: 

You might also want to take a look at Kay Framework. It's based on Django with middleware and such. It is exclusively geared towards App Engine and uses Werkzeug and Jinja2. I have fiddled with it and it all works. I've settled on the already mentioned Tipfy framework. Also comes with Jinja2 (and Mako, it's your choice), it's lightweight and easy to comprehend.

dlib
+1  A: 

Google has developed a 'helper' project to aid with Django integration: http://code.google.com/p/google-app-engine-django/

Also, you might check out this video where Guido walks through it: http://sites.google.com/site/io/rapid-development-with-python-django-and-google-app-engine

Eric