Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python26\lib\site-packages\django\template\base.py", line 123, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "D:\Python26\lib\site-packages\django\conf\__init__.py", line 54, in __getattr__
self._setup(name)
File "D:\Python26\lib\site-packages\django\conf\__init__.py", line 47, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATE_DEBUG, but settings are not configured. You must either define the enviro
File "<stdin>", line 1, in <module>
File "D:\Python26\lib\site-packages\django\template\base.py", line 123, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "D:\Python26\lib\site-packages\django\conf\__init__.py", line 54, in __getattr__
self._setup(name)
File "D:\Python26\lib\site-packages\django\conf\__init__.py", line 47, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting TEMPLATE_DEBUG, but settings are not configured. You must either define the enviro
nment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
解决方法:
>>> from django.conf import settings
>>> settings.configure()