app/gae_django.py
changeset 2414 a95ba3595554
parent 2335 366e64ecba91
--- 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