我这样安装和配置了Django/MongoDB!
pip install virtualenv
source myproject/bin/activate
pip install hg+https://bitbucket.org/wkornewald/django-nonrel
pip install hg+https://bitbucket.org/wkornewald/djangotoolbox
pip install git+https://github.com/django-nonrel/mongodb-engine
所有这些行动都是成功的!
现在,当我这样更改settings.py文件时:
DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mong_db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
出现弯曲思维错误:
Error was: No module named django_mongodb_engine.base
显然django_mongodb_引擎安装成功了。但为什么会出现这个错误呢?
顺便说一句,原谅我英语不好!
我经历了与您相同的步骤,然后打开了一个Python shell:
但如果我这样做了:
。。。它起作用了。
可以设置DJANGO_SETTINGS_模块并尝试在Python shell中导入DJANGO_mongodb_engine.base吗?
相关问题 更多 >
编程相关推荐