File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -103,16 +103,8 @@ $ python manage.py startapp myapp --template https://github.com/mongodb-labs/dja
103103
104104### Configuring the ` DATABASES ` setting
105105
106- After you've set up a project, configure Django's ` DATABASES ` with
107- ` django_mongodb.parse(uri) ` :
108-
109- ``` python
110- MONGODB_URI = " mongodb://<my_user>:<my_password>@localhost:27017/my_database"
111- DATABASES [" default" ] = django_mongodb.parse(MONGODB_URI )
112- ```
113-
114- Alternatively, if you prefer to edit the Python dictionary directly, you can
115- configure the nested keys and values of the ` DATABASES ` setting individually:
106+ After you've set up a project, configure Django's ` DATABASES ` setting similar
107+ to this:
116108
117109``` python
118110DATABASES = {
@@ -129,6 +121,16 @@ DATABASES = {
129121` OPTIONS ` is an optional dictionary of parameters that will be passed to
130122[ ` MongoClient ` ] ( https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html ) .
131123
124+ Alternatively, you can configure Django's ` DATABASES ` with
125+ ` django_mongodb.parse(uri) ` :
126+
127+ ``` python
128+ import django_mongodb
129+
130+ MONGODB_URI = " mongodb://<my_user>:<my_password>@localhost:27017/my_database"
131+ DATABASES [" default" ] = django_mongodb.parse(MONGODB_URI )
132+ ```
133+
132134Congratulations, your project is ready to go!
133135
134136## Notes on Django QuerySets
You can’t perform that action at this time.
0 commit comments