- 论坛徽章:
- 0
|
请教import django.db.models.Model 后出现以下异常,请问是什么原因?能解决不?
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import django.db.models.Model
File "C:\Python25\Lib\site-packages\django\db\__init__.py", line 14, in <module>
if not settings.DATABASES:
File "C:\Python25\Lib\site-packages\django\utils\functional.py", line 276, in __getattr__
self._setup()
File "C:\Python25\Lib\site-packages\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. |
|