Trouble using MongoDB as backend for Django project (Django 1.7)

╄→尐↘猪︶ㄣ 提交于 2019-12-31 03:53:24

问题


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

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.

My DATABASES setting is as follows,

DATABASES = {
   'default' : {
      'ENGINE' : 'django_mongodb_engine',
      'NAME' : 'example_db'
   }
}

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', 
)

Thank you!


回答1:


django-mongo-db-engine does not work with Django 1.7. It uses Django-nonrel, (a fork of Django) instead of Django.

Try creating your dev environment again, but this time, do not install Django 1.7.



来源:https://stackoverflow.com/questions/27988670/trouble-using-mongodb-as-backend-for-django-project-django-1-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!