如何设置DJANGO_SETTINGS_MODULE?

时间:2014-06-07 15:09:56

标签: python

我有这个结构:

example.com
— bin
— include
— lib
— local
— project
    |— manage.py
    |— project
         |— __init__.py
         |— settings.py
         |— urls.py
         |— wsgi.py

我设置export DJANGO_SETTINGS_MODULE=project.settings并尝试使用以下命令安装mongodb:

pip install git+https://github.com/django-nonrel/mongodb-engine

执行后,会发生以下错误:

Downloading/unpacking git+https://github.com/django-nonrel/mongodb-engine
  Cloning https://github.com/django-nonrel/mongodb-engine to /tmp/pip-Gv3V7O-build
  Running setup.py egg_info for package from git+https://github.com/django-nonrel/mongodb-engine
    ERROR:root:Error while trying to get django settings module.
    Error was: Could not import settings 'project.settings' (Is it on sys.path?): No module named project.settings

Requirement already satisfied (use --upgrade to upgrade): pymongo in ./lib/python2.7/site-packages (from django-mongodb-engine==0.5.2)
Requirement already satisfied (use --upgrade to upgrade): djangotoolbox>=1.6.0 in ./lib/python2.7/site-packages (from django-mongodb-engine==0.5.2)
Cleaning up...

我该如何解决?

0 个答案:

没有答案