我以这种方式安装和配置了 Django/MongoDB!
点安装虚拟环境
源 myproject/bin/激活
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.
}
出现令人费解的错误:</p>
Error was: No module named django_mongodb_engine.base
显然django_mongodb_engine 安装成功。但是为什么会出现这个错误呢?
顺便说一句,原谅我糟糕的英语!