我有一个在虚拟环境中运行的 django 实例
# python manage.py shell
Traceback (most recent call last):
File "manage.py", line 3, in <module>
from app.models import *
File "/production/project/app/models.py", line 1, in <module>
from django.db import models
File "/production/pythonenv/django15/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/production/pythonenv/django15/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/production/pythonenv/django15/lib/python2.7/site-packages/django/conf/__init__.py", line 46, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
解决此问题的最简单方法是什么?