mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #35401 -- Linked the CsrfViewMiddleware docs to the csrf_protect() decorator.
This commit is contained in:
parent
719a42b589
commit
708b01c795
@ -152,7 +152,8 @@ class-based views<decorating-class-based-views>`.
|
|||||||
|
|
||||||
.. function:: csrf_protect(view)
|
.. function:: csrf_protect(view)
|
||||||
|
|
||||||
Decorator that provides the protection of ``CsrfViewMiddleware`` to a view.
|
Decorator that provides the protection of
|
||||||
|
:class:`~django.middleware.csrf.CsrfViewMiddleware` to a view.
|
||||||
|
|
||||||
Usage::
|
Usage::
|
||||||
|
|
||||||
|
@ -569,6 +569,9 @@ Adds protection against Cross Site Request Forgeries by adding hidden form
|
|||||||
fields to POST forms and checking requests for the correct value. See the
|
fields to POST forms and checking requests for the correct value. See the
|
||||||
:doc:`Cross Site Request Forgery protection documentation </ref/csrf>`.
|
:doc:`Cross Site Request Forgery protection documentation </ref/csrf>`.
|
||||||
|
|
||||||
|
You can add Cross Site Request Forgery protection to individual views using the
|
||||||
|
:func:`~django.views.decorators.csrf.csrf_protect()` decorator.
|
||||||
|
|
||||||
``X-Frame-Options`` middleware
|
``X-Frame-Options`` middleware
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user