mirror of
https://github.com/django/django.git
synced 2025-08-31 15:57:45 +00:00
Used :envvar: role and .. envvar:: directive in various docs.
This commit is contained in:
parent
feb91dbda1
commit
fbdb032de2
15 changed files with 65 additions and 49 deletions
|
@ -283,8 +283,8 @@ at the top level (i.e. evaluated when the module is imported). The explanation
|
|||
for this is as follows:
|
||||
|
||||
Manual configuration of settings (i.e. not relying on the
|
||||
``DJANGO_SETTINGS_MODULE`` environment variable) is allowed and possible as
|
||||
follows::
|
||||
:envvar:`DJANGO_SETTINGS_MODULE` environment variable) is allowed and possible
|
||||
as follows::
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
|
|
@ -105,8 +105,8 @@ The remainder of this documentation shows commands for running tests without
|
|||
``tox``, however, any option passed to ``runtests.py`` can also be passed to
|
||||
``tox`` by prefixing the argument list with ``--``, as above.
|
||||
|
||||
Tox also respects the ``DJANGO_SETTINGS_MODULE`` environment variable, if set.
|
||||
For example, the following is equivalent to the command above:
|
||||
Tox also respects the :envvar:`DJANGO_SETTINGS_MODULE` environment variable, if
|
||||
set. For example, the following is equivalent to the command above:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
@ -156,7 +156,7 @@ those for ``contrib.postgres``, are specific to a particular database backend
|
|||
and will be skipped if run with a different backend.
|
||||
|
||||
To run the tests with different settings, ensure that the module is on your
|
||||
``PYTHONPATH`` and pass the module with ``--settings``.
|
||||
:envvar:`PYTHONPATH` and pass the module with ``--settings``.
|
||||
|
||||
The :setting:`DATABASES` setting in any test settings module needs to define
|
||||
two databases:
|
||||
|
@ -495,8 +495,8 @@ test failures. You can adjust this behavior with the ``--parallel`` option:
|
|||
|
||||
$ ./runtests.py basic --parallel=1
|
||||
|
||||
You can also use the ``DJANGO_TEST_PROCESSES`` environment variable for this
|
||||
purpose.
|
||||
You can also use the :envvar:`DJANGO_TEST_PROCESSES` environment variable for
|
||||
this purpose.
|
||||
|
||||
Tips for writing tests
|
||||
======================
|
||||
|
|
|
@ -246,6 +246,10 @@ documentation:
|
|||
* Use :rst:role:`:mimetype:<mimetype>` to refer to a MIME Type unless the value
|
||||
is quoted for a code example.
|
||||
|
||||
* Use :rst:role:`:envvar:<envvar>` to refer to an environment variable. You may
|
||||
also need to define a reference to the documentation for that environment
|
||||
variable using :rst:dir:`.. envvar:: <envvar>`.
|
||||
|
||||
Django-specific markup
|
||||
======================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue