PROD - QUEUE - DJANGO_SETTINGS_MODULE is undefined

276 views
Skip to first unread message

Amine Azariz

unread,
May 28, 2012, 6:23:53 AM5/28/12
to google-a...@googlegroups.com

I am using Django 1.2, Python 2.5. This error happens from time to time. - e.g. some tasks got this error, some - not.

How to solve this one?

File "/base/python_runtime/python_lib/versions/third_party/django-1.2/django/template/loader.py", line 168, in get_template_from_string
    return Template(source, origin, name)
  File "/base/python_runtime/python_lib/versions/third_party/django-1.2/django/template/__init__.py", line 156, in __init__
    if settings.TEMPLATE_DEBUG and origin is None:
  File "/base/python_runtime/python_lib/versions/third_party/django-1.2/django/utils/functional.py", line 276, in __getattr__
    self._setup()
  File "/base/python_runtime/python_lib/versions/third_party/django-1.2/django/conf/__init__.py", line 38, in _setup
    raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

Matt McDonald

unread,
May 28, 2012, 11:21:12 AM5/28/12
to google-a...@googlegroups.com
Define the DJANGO_SETTINGS_MODULE environment variable in your app.yaml config.

This will ensure it's always available to any entry point that's handling a request.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/A1bWVSwArvMJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

D X

unread,
May 29, 2012, 11:44:28 AM5/29/12
to google-a...@googlegroups.com
I sometimes see this on dev_appserver when I use the datastore admin page locally, afterwards I usually need to reset the dev_appserver.  It doesn't cause a problem on production, but I'll give Matt's suggestion a try.

Amine Azariz

unread,
Jun 4, 2012, 5:22:50 AM6/4/12
to google-a...@googlegroups.com
Hi Guys,

Thanks you Matt for the tip, I think it's ok now
Reply all
Reply to author
Forward
0 new messages