Refs #31949 -- Made make_middleware_decorator to work with async functions.

This commit is contained in:
Ben Lomax 2023-07-08 22:51:19 +01:00 committed by Mariusz Felisiak
parent 059cb0dbc9
commit 74f7deec9e
8 changed files with 214 additions and 11 deletions

View file

@ -170,6 +170,10 @@ class-based views<decorating-class-based-views>`.
# ...
return render(request, "a_template.html", c)
.. versionchanged:: 5.0
Support for wrapping asynchronous view functions was added.
.. function:: requires_csrf_token(view)
Normally the :ttag:`csrf_token` template tag will not work if
@ -190,10 +194,18 @@ class-based views<decorating-class-based-views>`.
# ...
return render(request, "a_template.html", c)
.. versionchanged:: 5.0
Support for wrapping asynchronous view functions was added.
.. function:: ensure_csrf_cookie(view)
This decorator forces a view to send the CSRF cookie.
.. versionchanged:: 5.0
Support for wrapping asynchronous view functions was added.
Settings
========