summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2020-02-12 15:15:00 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-03-18 19:59:12 +0100
commitfc0fa72ff4cdbf5861a366e31cb8bbacd44da22d (patch)
treed419ce531586808b0a111664907b859cb6d22862 /docs/ref
parent3f7e4b16bf58f99c71570ba75dc97db8265071be (diff)
Fixed #31224 -- Added support for asynchronous views and middleware.
This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/utils.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 741ed585f2..0375b2e63b 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -210,6 +210,31 @@ The functions defined in this module share the following properties:
def my_view(request):
pass
+.. function:: sync_only_middleware(middleware)
+
+ .. versionadded:: 3.1
+
+ Marks a middleware as :ref:`synchronous-only <async-middleware>`. (The
+ default in Django, but this allows you to future-proof if the default ever
+ changes in a future release.)
+
+.. function:: async_only_middleware(middleware)
+
+ .. versionadded:: 3.1
+
+ Marks a middleware as :ref:`asynchronous-only <async-middleware>`. Django
+ will wrap it in an asynchronous event loop when it is called from the WSGI
+ request path.
+
+.. function:: sync_and_async_middleware(middleware)
+
+ .. versionadded:: 3.1
+
+ Marks a middleware as :ref:`sync and async compatible <async-middleware>`,
+ this allows to avoid converting requests. You must implement detection of
+ the current request type to use this decorator. See :ref:`asynchronous
+ middleware documentation <async-middleware>` for details.
+
``django.utils.encoding``
=========================