我想在我的应用程序和I used this documentation as reference中使用MongoDB。
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.dummy',
}
}
SESSION_ENGINE = "mongoengine.django.sessions"
_MONGODB_HOST = "localhost"
_MONGODB_NAME = "erayerdin_blog"
_MONGODB_DATABASE_HOST = "mongodb://{}/{}".format(_MONGODB_HOST, _MONGODB_NAME)
mongoengine.connect(_MONGODB_NAME, host=_MONGODB_DATABASE_HOST)
如果我想django.db.backends.dummy
,ImproperlyConfigured
或空字符串只会引发migrate
。如何在Django中传递虚拟引擎?
raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
答案 0 :(得分:1)
这是“Dummy”后端的预期行为 - 它充当存根/默认后端,如果您实际start to use it - migrate
尝试使用虚拟后端,它会开始抱怨。< / p>