run demo django app on google app engine (DJANGO_SETTINGS_MODULE is undefined.) -
i trying run django 1.3 test app named polls in googleappenginelauncher version 1.6.6 , getting following error. can tell me how this, please?
importerror: settings cannot imported, because environment variable django_settings_module undefined. info 2012-06-05 19:08:30,766 dev_appserver.py:2904] "get /polls/1/ http/1.1" 500 - i have placed app.yaml in app directory, not project directory, , may problem, here current app.yaml. also, have declared views.py main script, guess.
application: ctst version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /_ah/queue/deferred script: djangoappengine.deferred.handler.application login: admin - url: /.* script: views.app libraries: - name: django version: "1.3" my mysite , polls directories follows.
server:mysite brian$ ls -l total 352 -rw-r--r-- 1 brian staff 0 jun 4 10:22 __init__.py -rw-r--r-- 1 brian staff 155 jun 4 13:56 __init__.pyc -rw-r--r-- 1 brian staff 503 jun 4 10:22 manage.py drwxr-xr-x 20 brian staff 680 jun 5 14:54 polls -rw-r--r-- 1 brian staff 5273 jun 5 15:00 settings.py -rw-r--r-- 1 brian staff 2955 jun 5 15:00 settings.pyc drwxr-xr-x 2 brian staff 68 jun 4 14:04 sqlite3.db -rw-r--r-- 1 brian staff 147456 jun 5 11:42 sqlite3.dp -rw-r--r-- 1 brian staff 1048 jun 5 10:16 urls.py -rw-r--r-- 1 brian staff 464 jun 5 10:18 urls.pyc server:mysite brian$ ls -l polls/ total 104 -rw-r--r-- 1 brian staff 0 jun 4 14:23 __init__.py -rw-r--r-- 1 brian staff 151 jun 4 14:33 __init__.pyc -rw-r--r-- 1 brian staff 505 jun 4 16:33 admin.py -rw-r--r-- 1 brian staff 1123 jun 4 16:33 admin.pyc -rw-r--r-- 1 brian staff 263 jun 5 14:54 app.yaml -rw-r--r-- 1 brian staff 524 jun 4 14:50 models.py -rw-r--r-- 1 brian staff 1484 jun 4 14:50 models.pyc -rw-r--r-- 1 brian staff 383 jun 4 14:23 tests.py -rw-r--r-- 1 brian staff 708 jun 5 11:26 urls.py -rw-r--r-- 1 brian staff 902 jun 5 11:42 urls.pyc -rw-r--r-- 1 brian staff 1154 jun 5 11:41 views.py -rw-r--r-- 1 brian staff 1231 jun 5 11:42 views.pyc server:mysite brian$
try adding
import os os.environ['django_settings_module'] = 'settings' somewhere know it's called every request. note os.environ threadlocal python27, setting on initial import not enough.
Comments
Post a Comment