# HG changeset patch # User Pawel Solyga # Date 1245435543 -7200 # Node ID a95ba3595554336bb27cbfd261f31bba2fc31f3c # Parent d0b7dac5325c517e43168c0be9784c52b8f9a0d0 Use build-in django 1.0.x on deployed version of Melange. Using SDK (Development server) right now we are still using django.zip when running from build folder and django folder when running from app folder. django.zip file is still uploaded when deploying the app but it's not used. We might totally get rid of django folder and django.zip soon (discussion needed). diff -r d0b7dac5325c -r a95ba3595554 app/gae_django.py --- a/app/gae_django.py Fri Jun 19 16:13:32 2009 +0200 +++ b/app/gae_django.py Fri Jun 19 20:19:03 2009 +0200 @@ -27,15 +27,22 @@ ] -# Remove the standard version of Django. -for k in [k for k in sys.modules if k.startswith('django')]: - del sys.modules[k] +if os.environ['SERVER_SOFTWARE'].startswith('Dev'): + + # Remove the standard version of Django. + for k in [k for k in sys.modules if k.startswith('django')]: + del sys.modules[k] -# Force sys.path to have our own directory first, in case we want to import -# from it. This lets us replace the built-in Django -sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) + # Force sys.path to have our own directory first, in case we want to import + # from it. This lets us replace the built-in Django + sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) + sys.path.insert(0, os.path.abspath('django')) + sys.path.insert(0, os.path.abspath('django.zip')) -sys.path.insert(0, os.path.abspath('django.zip')) +else: + # Declare the Django version we need. + from google.appengine.dist import use_library + use_library('django', '1.0') # Force Django to reload its settings. from django.conf import settings