mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #31949 -- Made make_middleware_decorator to work with async functions.
This commit is contained in:
parent
059cb0dbc9
commit
74f7deec9e
8 changed files with 214 additions and 11 deletions
|
@ -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
|
||||
========
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue