MongoEngine: Incorrect Configured: settings.DATABASES incorrectly configured

Getting the following error while executing the next line of command

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

Mistake:

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

Follow the next steps for the file settings.py http://docs.mongoengine.org/en/latest/django.html

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

SESSION_ENGINE = 'mongoengine.django.sessions'
+4
source share
2 answers

check this out: http://petrkout.com/programming/setting-up-django-with-mongodb/

you are lacking

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

In the settings.py file.

+3
source

Check out the model file. When using mongoengine, you need to inherit the Documents class instead of models. Class model. See this section of the mongoengine documentation for more details.

0

All Articles