[英]Error: Could not import settings 'settings' (Is it on sys.path? Does it have syntax errors?): No module named settings
I am working a django project which uses django version 1.2.2. 我正在使用Django版本1.2.2的Django项目。 I am trying to runserver using manage.py or django-admin.py, but I am getting the error
我正在尝试使用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
The settings.py file is exists in the same directory where manage.py and wsgi.py exists. settings.py文件与manage.py和wsgi.py存在于同一目录中。 I tried it by passing the settings as an argument also
我也通过将设置作为参数传递来尝试
django-admin.py runserver --settings=settings.py
but still i get the same error that 但是我仍然得到相同的错误
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.
I am using django 1.2 first time. 我第一次使用django 1.2。 Help will be appriciated
帮助将被申请
Try to set DJANGO_SETTINGS_MODULE
environment variable properly 尝试正确设置
DJANGO_SETTINGS_MODULE
环境变量
export DJANGO_SETTINGS_MODULE=settings
or run django-admin as follow 或按以下方式运行django-admin
django-admin.py runserver --settings=settings
why don't you run 你为什么不跑
./manage.py runserver ./manage.py运行服务器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.