My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 872: Django 1.0 Support in App Engine
158 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jun 19
Type-Feature
Priority-Medium


This issue is read-only.
 
Reported by james.zhuo, Nov 17, 2008
Django 1.0 is currently not supported by the app engine environment and the 1000 file limit means 
that we can hardly build anything significant when the Django 1.0 framework is uploaded along 
with the app. Zipimport can be used to some extent but when the Django 1.0 framework is fully 
zipped it's 4MB in size which exceeds the google 1MB file size limit. 
Comment 1 by deo@google.com, Dec 01, 2008
Marking as a feature request.

Dan Sanderson has put together an article detailing how to get Django 1.0 running on
App Engine without hitting either the 1,000 file limit or the 1MB limit. It may be
useful in running 1.0 before we officially support it:
http://code.google.com/appengine/articles/django10_zipimport.html
Status: Acknowledged
Labels: -Type-Defect Type-Feature
Comment 2 by sebastianovide, Jan 09, 2009
I'm using app engine patch on every project. 
Comment 3 by drawkbox, Feb 09, 2009
Keeping up to date with django versions would be great for Python in general.  maybe
a way to explicitly choose the version in settings.py or the main handler?
Comment 4 by prosarath, Feb 18, 2009
it be easier to put django somethere in non path, and give us a configurable app.yaml
instruction or some small piece of code to patch in.. would also save a lot of space
on the servers.. reducing all those copies of the same zip to ONE!
Comment 5 by pas256, Feb 18, 2009
The above article listed by Deo is good, but I have written a more in depth tutorial
that works with GAE 1.1.9 using Django 1.0.2. Since I am new to Python, App Engine
and Django, any comments or improvements to the tutorial would be appreciated!

You can find the how-to here:
http://sankasaurus.blogspot.com/2009/02/django-and-google-app-engine-tutorial.html
Comment 6 by A.A.Vasiljev, Feb 18, 2009
Or, better yet, use app engine patch: http://code.google.com/p/app-engine-patch/
Comment 7 by j...@google.com, Mar 23, 2009
 Issue 1166  has been merged into this issue.
Comment 8 by tweetpage, Mar 23, 2009
Now that Django 1.1 has entered beta, please target it instead of 1.0.

Comment 9 by johan-ro...@freenerd.de, May 25, 2009
Django 1.1. is a must
Comment 10 by gvanrossum, Jun 02, 2009
Django 1.1 will come in a future release, and not before it's out of beta.
Comment 11 by codemaven, Jun 04, 2009
This is killing the response times of my low-traffic app, because apps are
aggressively flushed from memory, after 2-3 seconds, my app has to cold-start again
and zipimport django 1.0. This would not happen if supported by the app engine
directly. Until then, I am contemplating backporting my app to 0.96.
Comment 12 by markus.ochel, Jun 11, 2009
Django 1.1 native support is highly needed.
Comment 13 by samj+...@samj.net, Jun 18, 2009
This was fixed in 1.2.3: http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes
Comment 14 by gvanrossum, Jun 19, 2009
It's indeed fixed, though not yet documented.

To use:

1. Install Django 1.0 into the Python version you're using with the SDK (usually the
system Python).

2. In your app:
from google.appengine.dist import use_library
use_library('django', '1.0')

You no longer need to copy Django 1.0 into your app, nor do you need to mess with
sys.modules, sys.path and zipfiles.  (Though those instructions still apply if you
want to use Django 1.1 -- we'll start supporting that once it's out of beta.)

Note, Django 0.96 is still the default, and can also explicitly be requested by using
use_library('django', '0.96') -- in API v2, we'll probably change things so you
*have* to specify a Django version before you can use it.

We're contemplating the support of other open source packages as well (as long as
they don't contain C code).
Status: Fixed
Comment 15 by A.A.Vasiljev, Jun 19, 2009
Any chance for http://code.google.com/p/app-engine-patch/ ?
Comment 16 by m3moore, Jun 25, 2009
Shouldn't http://code.google.com/appengine/articles/django.html be updated to refer to Django 1.0?
Comment 17 by jesse.lovelace, Jun 26, 2009
This breaks GAE admin support if the admin (or any webapp because webapp imports django) is viewed before a 
Django handler that sets use_library(...) with a: 

google.appengine.dist._library.UnacceptableVersionError 

See issue #1758.
Comment 18 by gvanrossum, Jun 26, 2009
Unfortunately, that is indeed a current limitation.  The short-term work-around is to
hit / before hitting /_ah/admin after (re)starting the dev appserver.  Note that the
dev appserver effectively restarts whenever you edit any of the source code (.py
files) too.

As a long-term solution, I am not sure yet, but there has to be one.
Comment 19 by jesse.lovelace, Jun 29, 2009
A possible fix would be to allow us to override (or disable) the admin url mapping at /_ah/ and replace it with our 
own handler script that does something like this:

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

from google.appengine.ext.admin import main as admin_main

def main():
	admin_main()

Right now I have to map another url to do this, which seems wasteful.

Comment 20 by alsuren, Jul 15, 2009
The long-term solution might be along the lines suggested by prosarath: put it in the
app.yaml. If all we need is something that gets read whenever the server starts up,
and says which version of django we want then this sounds like the perfect solution.
Comment 21 by dilip.k.shukla, Jul 30, 2009
Django 1.1 is out of beta, when can we see it.
Comment 22 by gvanrossum, Jul 31, 2009
I started the process for including Django. There is a planned upcoming AppEngine
release that is too far through QA to add something like this; I expect Django 1.1
support to go into the release after that.
Comment 23 by wkornewald, Aug 02, 2009
You can also use app-engine-patch 1.1RC which comes with the latest Django 1.1 stable 
release:
http://code.google.com/p/app-engine-patch/
Comment 24 by bjschnei, Sep 28, 2009
i'm trying to use_library('django', '1.1'), but am getting "You haven't set the DATABASE_ENGINE setting yet." when 
leaving DATABASE_ENGINE = '' in my settings.py

what am i supposed to set this to for developement? 
Comment 25 by ethan.vandenberg, Sep 28, 2009
Django needs to modified to run on appengine. Try

http%3A%2F%2Fcode.google.com%2Fp%2Fapp-engine-
patch%2F&resnum=1&sa=X&usg=AFQjCNEtNckEQGeYXBJc7Q7rug4Q2fm2PA

or any of the other products from a google "django apengine". 

This question can probably be better answered in a google groups form. 
Comment 26 by gvanrossum, Sep 29, 2009
I'm not sure, but I think you can leave it unset -- that's what I do in Rietveld (check out 
http://code.google.com/p/rietveld/source/browse/trunk/settings.py ).
Comment 27 by niklasro, Oct 14, 2009
django 1.0 claimed be supported, still no django naturalday (1.0 filter) or just 
undocumented
Comment 28 by gvanrossum, Oct 14, 2009
@niklasro: did you put the use_library('django', '1.0') incantation in your code at the 
right place?
Comment 29 by niklasro, Oct 14, 2009
will give it 2nd try now kindly informed it can, tried it once and failed more miserably than anyone, naturalday 
seems natural view worth enabling, didn't see it reading the filter gae part which lead thought to naturalday 
was downprioritized
Comment 30 by agentriot, Oct 23, 2009
I am just using django templating system via as included by the fault in Google App
Engine:
  import google.appengine.ext.webapp.template

It seems this uses .96 syntax. Is there a simple way of just using the 1.0 (or 1.1)
Django templating system together with webapp?
Comment 31 by gvanrossum, Oct 23, 2009
Please ask further questions on the group.

This issue is read-only. New comments cannot be added.