7
Django DB设置“配置不正确”错误
Django(1.5)对我来说很好用,但是当我启动Python解释器(Python 3)进行检查时,尝试导入时会遇到最奇怪的错误from django.contrib.auth.models import User-- Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/django/conf/__init__.py", line 36, in _setup settings_module = os.environ[ENVIRONMENT_VARIABLE] File "/usr/lib/python3.2/os.py", line 450, in __getitem__ value = self._data[self.encodekey(key)] KeyError: b'DJANGO_SETTINGS_MODULE' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> …