From fc0fa72ff4cdbf5861a366e31cb8bbacd44da22d Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 12 Feb 2020 15:15:00 -0700 Subject: Fixed #31224 -- Added support for asynchronous views and middleware. This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client. --- docs/ref/utils.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs/ref') 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 `. (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 `. 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 `, + this allows to avoid converting requests. You must implement detection of + the current request type to use this decorator. See :ref:`asynchronous + middleware documentation ` for details. + ``django.utils.encoding`` ========================= -- cgit v1.3