首页 > 解决方案 > 如何在 Django 我们应用程序中为 mongoDB 连接配置 settings.py

问题描述

我收到以下错误:

django.core.exceptions.ImproperlyConfigured:
  'django_mongodb_engine' isn't an available database backend.

django 的官方文档说:

尝试使用'django.db.backends.XXX',其中XXX之一是:u'mysql', u'oracle', u'postgresql_psycopg2',u'sqlite3'

如您所见,mongodb文档中的列表中没有。

有什么建议么?

标签: djangomongodbconnection

解决方案


根据错误消息,可能django_mongodb_engine是没有正确安装:

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

在以下位置查看更多信息:https ://django-mongodb-engine.readthedocs.io/en/latest/topics/setup.html


推荐阅读