【发布时间】:2015-10-14 23:09:48
【问题描述】:
我正在开发一个使用 django 版本 1.2.2 的 django 项目。我正在尝试使用 manage.py 或 django-admin.py 运行服务器,但出现错误
Error: Could not import settings 'settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
settings.py 文件存在于 manage.py 和 wsgi.py 所在的同一目录中。我也尝试将设置作为参数传递
django-admin.py runserver --settings=settings.py
但我仍然遇到与
相同的错误Error: Can't find the file 'settings.py' in the directory
containing 'manage.py'. It appears you've customized things.
You'll have
to run django-admin.py, passing it your settings module.
(If the
file settings.py does indeed exist, it's causing an ImportError
somehow.
我第一次使用 django 1.2。帮助将被appriciated
【问题讨论】:
-
那么当您运行
python settings.py时会发生什么,会报告任何错误吗? -
在任何情况下,你绝对绝对不应该使用 Django 1.2。
-
你是对的@Martin,我在 settings.py 文件中有一些错误。谢谢