File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -121,14 +121,15 @@ DATABASES = {
121121` OPTIONS ` is an optional dictionary of parameters that will be passed to
122122[ ` MongoClient ` ] ( https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html ) .
123123
124- Alternatively, you can configure Django's ` DATABASES ` with
125- ` django_mongodb.parse(uri) ` :
124+ Alternatively, those that follow the [ twelve-factor app methodology] (
125+ https://www.12factor.net/backing-services ) can configure Django's ` DATABASES `
126+ with ` django_mongodb.parse_uri(MONGODB_URI) ` :
126127
127128``` python
128129import django_mongodb
129130
130- MONGODB_URI = " mongodb://<my_user>:<my_password>@localhost:27017/my_database "
131- DATABASES [" default" ] = django_mongodb.parse (MONGODB_URI )
131+ MONGODB_URI = " mongodb+srv ://myDatabaseUser:D1fficultP %40s sw0rd@cluster0.example.mongodb.net/myDatabase?retryWrites=true&w=majority&tls=false "
132+ DATABASES [" default" ] = django_mongodb.parse_uri (MONGODB_URI )
132133```
133134
134135Congratulations, your project is ready to go!
You can’t perform that action at this time.
0 commit comments