简体   繁体   English

错误:无法导入设置“设置”(在sys.path上吗?是否存在语法错误?):没有名为设置的模块

[英]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.

相关问题 错误:无法导入设置“ app”(在sys.path上吗?):在本地没有名为设置的模块 - Error: Could not import settings 'app' (Is it on sys.path?): No module named settings on Local ImportError:无法导入设置'mysite.settings'(是否在sys.path上?):没有名为mysite.settings的模块 - ImportError: Could not import settings 'mysite.settings' (Is it on sys.path?): No module named mysite.settings ImportError:无法导入设置“ wequest.settings”(在sys.path上吗?):没有名为wequest.settings的模块 - ImportError: Could not import settings 'wequest.settings' (Is it on sys.path?): No module named wequest.settings ImportError:无法导入设置“ company.foo.settings”(在sys.path上吗?):没有名为foo.settings的模块 - ImportError: Could not import settings 'company.foo.settings' (Is it on sys.path?): No module named foo.settings python:GeoDjango:Eclipse:在单元测试期间,引发ImportError,“无法导入设置'%s'(是否在sys.path上?是否有语法错误?) - python: GeoDjango: Eclipse: During Unit Test, raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?) ImportError:无法导入设置“ settings.py”(在sys.path上吗?):没有名为py的模块 - ImportError: Could not import settings 'settings.py' (Is it on sys.path?): No module named py 无法导入设置“myproject.settings”(是否在 sys.path 上?):没有名为 pinax 的模块 - Could not import settings 'myproject.settings' (Is it on sys.path?): No module named pinax ImportError:无法导入设置“ LJ.settings”(在sys.path上吗?):没有名为代码的模块 - ImportError: Could not import settings 'LJ.settings' (Is it on sys.path?): No module named code Django部署:ImportError:无法导入设置“ settings.py”(在sys.path上吗?):没有名为settings.py的模块 - Django Deployment: ImportError: Could not import settings 'settings.py' (Is it on sys.path?): No module named settings.py Django ImportError:无法导入设置“ mysite.settings.local”(在sys.path上吗?):没有名为settings.local的模块 - Django ImportError: Could not import settings 'mysite.settings.local' (Is it on sys.path?): No module named settings.local
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM