I am creating a django web application in which I need to use both mysql and mongodb.
I have used mongoengine for this thus:
mongoengine.connect("mongodb://username:password@localhost:27017/dbname")
In my django/settings.py:
DATABASES = {
'default':
'ENGINE': "django.db.backends.mysql",
'NAME': "dbname",
"USER": "username",
"PASSWORD": "password",
"HOST": "localhost",
"PORT": "3306",
}
How can I configure one more connection for MongoDB here and use it to return in routers.py
I'm using Django 1.8, so I cannot use django-norel/django-mongodb-engine
.