- 论坛徽章:
- 0
|
看到啄木鸟上面一篇关于Django自带的用户认证系统的介绍,学习了一下 文章地址:http://wiki.woodpecker.org.cn/moin/DjangoAuth-ZH
manage.py syncdb后创建超级用户那些没问题,认证系统装好了
然后我 from django.contrib.auth.models import User 时出问题了:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python25\Lib\site-packages\django\contrib\auth\models.py", line 3, in
<module>
from django.db import models
File "D:\Python25\Lib\site-packages\django\db\__init__.py", line 9, in <module
>
if not settings.DATABASE_ENGINE:
File "D:\Python25\Lib\site-packages\django\conf\__init__.py", line 28, in __ge
tattr__
self._import_settings()
File "D:\Python25\Lib\site-packages\django\conf\__init__.py", line 57, in _imp
ort_settings
raise ImportError("Settings cannot be imported, because environment variable
%s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable DJANGO_SE
TTINGS_MODULE is undefined.
我看了下setting.py里面的INSTALLED_APPS里面是有'django.contrib.auth'的
DATABASE_ENGINE我用的是'sqlite3'
DATABASE_NAME 是 'E:\\Django\\MyTest\\data.db'
怎么会 if not settings.DATABASE_ENGINE 这里出问题呢?
我之后以为是sqlite3不支持,换成oracle,结果还是一样的错
郁闷,不明白了。。。。。请高手指教 |
|