我試圖從django.db進口車型無法導入模型
執行
,但它給了以下錯誤.. :(
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/django/db/__init__.py", line 14, in <module> if not settings.DATABASES: File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/django/utils/functional.py", line 276, in __getattr__ self._setup() File "/Library/Python/2.6/site-packages/Django-1.2.2-py2.6.egg/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.
感謝ü:)這似乎很簡單,但只有當你說:) –
不客氣。 – solartic