I'm unable to run django mongo engine properly.
My database entry in settings.py is
DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine',
'NAME': 'local',
}
}
and my pip freeze result is
Django==1.8.2
django-mongodb-engine==0.5.2
djangotoolbox==1.6.2
pymongo==3.0.2
error while running
python manage.py runserver
is
django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
u'base', u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: cannot import name BaseDatabaseFeatures
Any suggestions how to solve this.
I had this issue. If you plan to work with
Django 1.7.x, 1.8.x
, a lib that works just fine is:django-mongoengine v0.2.1
In later versions (
pip install django-mongoengine
) it comes forced the install of Django 2.x (which you can still cancel by adding--no-deps
) but still, less hassle if force the django-mongoengine package version by: `pip install git+https://github.com/MongoEngine/django-mongoengine@v0.2.1The
requirements.txt
file remains something like this:The good of of django-mongoengine is that mongoengine easily allows you to access pymongo methods:
Try uninstalling 'Pymongo' and install it as 'pip install pymongo' as compared to installing it via an ide
But, the main drawback is
django-nonrel
works only if you usePython2.x
, it cannot work withPython3.x
This error occurs because the django utils.py file does not recognize that django is an available backend, to solve this error, please follow these steps:
You need
django-nonrel
installed as well, as per the documentation.