使用MongoDB作为Django项目的后端(Django 1.7) [英] Trouble using MongoDB as backend for Django project (Django 1.7)
问题描述
我使用以下教程设置了我的应用程序,
http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html
当我在我的settings.py中的这个链接中设置我的后端时,我得到以下错误:
I set up my app using the following tutorial, http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html When I set my backend as detailed in this link in my settings.py, I get the following error:
NotImplementedError: subclasses of BaseDatabaseIntrospection may require
a get_table_list() method
我已经安装了所有必需的软件包(django-nonrel,djangotoolbox,mongodb-engine),但是我仍然收到这些错误。我可能做错了什么/我错过了这很可能是微不足道的 - 我是Django和MongoDB的新手。
I have installed all the necessary packages (django-nonrel, djangotoolbox, mongodb-engine), but I'm still getting these errors. What might I be doing wrong/am I missing? It could very likely be something trivial-- I'm new to Django and MongoDB.
我的DATABASES设置如下,
My DATABASES setting is as follows,
DATABASES = {
'default' : {
'ENGINE' : 'django_mongodb_engine',
'NAME' : 'example_db'
}
}
我的INSTALLED_APPS如下,
and my INSTALLED_APPS are as follows,
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mongoadmin',
'mongoengine.django.mongo_auth',
'polls',
)
谢谢!
推荐答案
django-mongo-db-engine不适用于Django 1.7。它使用
Django-nonrel(Django的一个fork)而不是Django。
django-mongo-db-engine does not work with Django 1.7. It uses Django-nonrel, (a fork of Django) instead of Django.
尝试再次创建您的开发环境,但是这一次,不要安装Django 1.7。
Try creating your dev environment again, but this time, do not install Django 1.7.
这篇关于使用MongoDB作为Django项目的后端(Django 1.7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!