gpt4 book ai didi

python - MongoEngine : ImproperlyConfigured: settings. 数据库配置不正确

转载 作者:太空宇宙 更新时间:2023-11-03 11:05:31 25 4
gpt4 key购买 nike

执行以下命令时出现以下错误

from django.contrib.sessions.models import Session
session = Session.objects.get(pk=session_key)

错误:

ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the   ENGINE value. Check settings documentation for more details.

settings.py 文件执行以下步骤 http://docs.mongoengine.org/en/latest/django.html

DATABASES = {
'default': {
'ENGINE' : 'django.db.backends.dummy',
},
}

SESSION_ENGINE = 'mongoengine.django.sessions'

最佳答案

检查这个:http://petrkout.com/programming/setting-up-django-with-mongodb/

你缺少

from mongoengine import connect
connect('employeedb', username='my_username', password='secret_password')

在您的 settings.py 文件中。

关于python - MongoEngine : ImproperlyConfigured: settings. 数据库配置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20465921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com