[3.1.x] Used :envvar: role and .. envvar:: directive in various docs.

Backport of fbdb032de2 from master
This commit is contained in:
Nick Pope 2020-04-30 11:12:05 +01:00 committed by Mariusz Felisiak
parent 345fa40cb5
commit 4eb5e4ee4f
15 changed files with 65 additions and 49 deletions

View file

@ -120,6 +120,8 @@ mode if you have asynchronous code in your project.
Async safety
============
.. envvar:: DJANGO_ALLOW_ASYNC_UNSAFE
Certain key parts of Django are not able to operate safely in an async
environment, as they have global state that is not coroutine-aware. These parts
of Django are classified as "async-unsafe", and are protected from execution in
@ -146,7 +148,7 @@ if the requirement is forced on you by an external environment, such as in a
Jupyter_ notebook. If you are sure there is no chance of the code being run
concurrently, and you *absolutely* need to run this sync code from an async
context, then you can disable the warning by setting the
``DJANGO_ALLOW_ASYNC_UNSAFE`` environment variable to any value.
:envvar:`DJANGO_ALLOW_ASYNC_UNSAFE` environment variable to any value.
.. warning::