Description:
Cleanup appengine_config.py
Please review this at http://codereview.appspot.com/5672068/
Affected files:
M appengine_config.py
Index: appengine_config.py
===================================================================
--- a/appengine_config.py
+++ b/appengine_config.py
@@ -35,14 +35,8 @@
from google.appengine.dist import use_library
use_library('django', '1.2')
-# Fail early if we can't import Django 1.x. Log identifying information.
-import django
-logging.info('django.__file__ = %r, django.VERSION = %r',
- django.__file__, django.VERSION)
-assert django.VERSION[0] >= 1, "This Django version is too old"
+# Django configuration module needs to be set explicitly as a workaround
+# http://code.google.com/p/googleappengine/issues/detail?id=5795
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+# NOTE: All "main" scripts must import webapp.template before django.
-# Custom Django configuration.
-# NOTE: All "main" scripts must import webapp.template before django.
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
-from django.conf import settings
-settings._target = None
I don't see a bug here too. Settings DJANGO_SETTINGS_MODULE is common
practice when setting up a Django environment manually.
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
See http://paste.kde.org/423776/
I've recheck with 1.6.2. It is still actual and magic. On page refresh
traceback changes to http://paste.kde.org/423782/
What a timewaste. :sad:
I only wonder if the requirement for all "main" scripts to import
webapp.template before django is still actual?
Switch to Python 2.7 and you won't need this any more...
--
--Guido van Rossum (python.org/~guido)