当我尝试使用 Django 测试网站时,它会报告错误。
python manage.py shell
它报告说:
错误:无法导入设置“test.settings”(它在 sys.path 上吗?):没有名为 settings 的模块
但是当我使用 Python 脚本查找“test.settings”时,我找不到它:
Python 2.7.3 (default, Sep 26 2012, 21:53:58)
>>> import sys
>>> print sys.path
> ['',
> '/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg',
> '/usr/local/lib/python2.7/dist-packages', '/usr/bin/python2.7',
> '/home/hua/django/mysite/~share', '/usr/lib/python2.7',
> '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk',
> '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload',
> '/usr/local/lib/python2.7/dist-packages',
> '/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg-info',
> '/usr/lib/python2.7/dist-packages',
> '/usr/lib/python2.7/dist-packages/PIL',
> '/usr/lib/python2.7/dist-packages/gst-0.10',
> '/usr/lib/python2.7/dist-packages/gtk-2.0',
> '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
>>>