Skip to content

Commit 7b2d67b

Browse files
authored
Refer to DATABASES as a setting, not a variable
1 parent f3d7145 commit 7b2d67b

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

source/connect.txt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ Overview
2323
In this guide, you can learn how to configure your Django project's
2424
connection to MongoDB.
2525

26-
Connection Configuration
26+
Connection Configuration
2727
------------------------
2828

2929
After installing {+django-odm+} and creating a project, you can configure
3030
your connection to MongoDB in the following ways:
3131

3232
- :ref:`django-connection-configure-manual` by specifying the
33-
``DATABASES`` variable in your project's settings.
33+
``DATABASES`` setting in your project's settings.
3434
- :ref:`django-connection-configure-automatic` by using
3535
the ``parse_uri()`` function.
3636

@@ -44,10 +44,9 @@ your connection to MongoDB in the following ways:
4444
Manually Configure Database Settings
4545
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4646

47-
To manually configure your connection to MongoDB, update
48-
the ``DATABASES`` variable in your project's ``settings.py``
49-
file. Set the ``DATABASES`` variable to a dictionary value containing
50-
the ``default`` key, as shown in the following example:
47+
To manually configure your connection to MongoDB, update the
48+
``DATABASES`` setting in your project's ``settings.py`` file. Set it to
49+
a dictionary containing the ``default`` key:
5150

5251
.. code-block:: python
5352

@@ -71,7 +70,7 @@ This nested dictionary has the following keys:
7170
- The backend driver to use for the connection. Set this key to ``"django_mongodb_backend"``.
7271

7372
* - **HOST**
74-
- | Your connection URI. For localhost connections, this key is optional.
73+
- | Your connection URI. For localhost connections, this key is optional.
7574
| For SRV connections, you must include a scheme prefix (``mongodb+srv://``).
7675
|
7776
| To specify more than one host, include all hostnames in one string. Use
@@ -101,11 +100,10 @@ This nested dictionary has the following keys:
101100

102101
.. _django-manual-config-example:
103102

104-
Example
103+
Example
105104
```````
106105

107-
In this example, the ``DATABASES`` variable performs the
108-
following actions:
106+
In this example, the ``DATABASES`` setting performs the following actions:
109107

110108
- Sets the database to ``my_database``
111109
- Provides authentication information for a database user
@@ -147,15 +145,15 @@ function accepts the following arguments:
147145
- ``uri``: Your MongoDB connection URI.
148146
- ``db_name``: The name of the database you want to use.
149147
- ``conn_max_age``: Configures persistent database connections.
150-
This argument is optional. To learn more, see
148+
This argument is optional. To learn more, see
151149
`Persistent connections <{+django-docs+}/ref/databases/#persistent-database-connections>`__
152150
in the {+framework+} documentation.
153151
- ``test``: Provides a dictionary of settings for test
154-
databases. This argument is optional. To learn more, see
152+
databases. This argument is optional. To learn more, see
155153
`the TEST setting <{+django-docs+}/ref/settings/#test>`__
156154
in the {+framework+} documentation.
157155

158-
Example
156+
Example
159157
```````
160158

161159
The following example uses the ``parse_uri()`` function to specify
@@ -177,4 +175,4 @@ see the :ref:`django-get-started-connect` step in the Getting Started
177175
tutorial.
178176

179177
To learn more about {+framework+} settings, see `Settings <{+django-docs+}/ref/settings/>`__
180-
in the {+framework+} documentation.
178+
in the {+framework+} documentation.

0 commit comments

Comments
 (0)