views:

749

answers:

4

There seem to be 2 ways to use django 1.1 with GAE

We currently use the first. Should we switch? And what's the difference between the two?

+1  A: 

FYI, there is at least one more way to get Django 1.1 in GAE.

Take a look at http://code.google.com/p/app-engine-patch/

It allows use to use most of Django features including Admin.

Andrey Fedoseev
As commented by Chango, app-engine patch seems to be [dead](http://code.google.com/p/app-engine-patch/issues/detail?id=253).
Casebash
+8  A: 

use_library loads an unpatched version of django in the production environment, so many things will not work out of the box on app-engine.

The helper applies a series of patches to the django libraries to enable things like Sessions, test, cache framework, etc. If you do not add your own copy of django into your helper application and you are using the latest release (r100 or higher), the helper first tries to load django 1.1 and if it does not succeed then loads 1.0. You can see this in appengine_django/__init__.py::LoadDjango.

On production GAE, django 1.1 always exists, so it is loaded first.

However, on your development environment the dev server SDK does not distribute Django. Therefore, it uses whatever version of Django it can find, first trying 1.1 and then 1.0 and if it cannot find one then throws UnacceptableVersionError.

You probably want to use the helper and not use_library because then you will need to patch the raw django libraries yourself, thus duplicating the work in the helper. Whether you distribute your own version of django, either as a folder or zip file is up to you. One of the advantages of not distributing your own copy of django is that as google applies security patches you automatically get them without having to redeploy your application.

dar
So use Django Helper, but make sure we use the latest revision. Great answer, thanks.
Paul Biggar
Final query - I think we still need to include 1.1 in a django.zip?
Paul Biggar
No if you want to use 1.1 the helper will load 1.1 for you, you do not need to include 1.1 in a django zip file.
dar
+1  A: 

app-engine-patch seems to have died:

http://code.google.com/p/app-engine-patch/issues/detail?id=253

Chango
+2  A: 

the replacement is called django-nonrel (and djangoappengine)... you can find it at http://www.allbuttonspressed.com ... with django-nonrel, you should be able to run pure Django apps on top of App Engine without tweaking your models!

wescpy