I am trying to connect my django instance to a mongo db cluster using django. I have checked from various sources and the way it is getting closer to work is:
Install djongo package using
pip install djongo
.
Make sure you import following module:
import urllib
Setup database settings.
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': '',
'HOST': "mongodb+srv://:" +
urllib.parse.quote_plus("") +
"@........mongodb.net/test?retryWrites=true&ssl=true&ssl_cert_reqs=CERT_NONE&w=majority",
}
}
Substitute db_username, db_name and db_password with your credentials.
Also edit the host name given by Mongo Atlas.