@@ -29,8 +29,8 @@ Connection Configuration
29
29
After installing {+django-odm+} and creating a project, you can configure
30
30
your connection to MongoDB in the following ways:
31
31
32
- - :ref:`django-connection-configure-manual` by updating your
33
- project's ``DATABASES`` setting
32
+ - :ref:`django-connection-configure-manual` by specifying the
33
+ ``DATABASES`` variable in your project's settings
34
34
- :ref:`django-connection-configure-automatic` by using
35
35
the ``parse_uri()`` method
36
36
@@ -45,13 +45,14 @@ Manually Configure Database Settings
45
45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
46
47
47
To manually configure your connection to MongoDB, update
48
- the ``DATABASES`` setting in your project's ``settings.py``
49
- file. The ``DATABASES`` setting has a ``default`` key,
50
- which you must configure to set MongoDB as the default database
48
+ the ``DATABASES`` variable in your project's ``settings.py``
49
+ file. Set the ``DATABASES`` variable to a dictionary value containing
50
+ the database settings. You must configure the dictionary's
51
+ ``default`` key to set MongoDB as the default database
51
52
connection.
52
53
53
- To configure the ``default`` key, include the following
54
- nested keys:
54
+ To configure the ``default`` key, assign a nested dictionary as its value.
55
+ This nested dictionary has the following keys:
55
56
56
57
.. list-table::
57
58
:header-rows: 1
@@ -91,7 +92,7 @@ nested keys:
91
92
Example
92
93
```````
93
94
94
- This example specifies the ``DATABASES`` setting to connect
95
+ This example specifies the ``DATABASES`` variable to connect
95
96
to a MongoDB deployment with the following configuration:
96
97
97
98
- Connects to the ``my_database`` database
@@ -125,7 +126,7 @@ to a MongoDB deployment with the following configuration:
125
126
.. tip::
126
127
127
128
To see a full list of connection options that you
128
- can set in the ``OPTIONS`` nested key, see the optional
129
+ can set in the ``OPTIONS`` key, see the optional
129
130
parameters for `MongoClient <https://pymongo.readthedocs.io/en/4.10.1/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient>`__
130
131
in the PyMongo API documentation.
131
132
0 commit comments