How do I connect Postgres and MongoDB at the same time in my Django project? I'm just clueless, and the MongoEngine documentation wasn't exactly helpful. Like what would I do in the settings, models, and views.py? Absolutely clueless. I mean, would I use a db_alias?
Asked
Active
Viewed 116 times
0
-
Did you take a look at the Django docs on using multiple databases? see https://docs.djangoproject.com/en/2.1/topics/db/multi-db/ -- the setup should be simple. – kchan Apr 17 '19 at 22:50
-
Checked it out before. I'm using MongoEngine, and the way they do it is somewhat weird. They leave the database settings blank then configure the database after an import of mongoengine's connect. https://leadwithoutatitle.wordpress.com/2018/03/21/how-to-setup-django-django-rest-framework-mongo/ Any ideas? – Apr 18 '19 at 02:32
-
It looks like `mongoengine` doesn't support Django integration (http://docs.mongoengine.org/django.html) but they refer to a new connector app called [djongo](https://nesdis.github.io/djongo/). You may want to try that (the docs have intructions on Django `DATABASE` configurations (https://nesdis.github.io/djongo/get-started/). I haven't used MongoDB with Django so I'm not sure I can offer any help, sorry! – kchan Apr 18 '19 at 04:36