diff options
| author | lufafajoshua <77637648+lufafajoshua@users.noreply.github.com> | 2024-06-12 12:25:39 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-06-12 13:11:29 +0200 |
| commit | 708b01c79501eb9fd73cc5f01a724205d70a6d30 (patch) | |
| tree | 08d5136a27468f380b817d304083b64b52b4649c /docs | |
| parent | 719a42b589d7551fc84708044b9e984ce723c8a2 (diff) | |
Refs #35401 -- Linked the CsrfViewMiddleware docs to the csrf_protect() decorator.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/csrf.txt | 3 | ||||
| -rw-r--r-- | docs/ref/middleware.txt | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/ref/csrf.txt b/docs/ref/csrf.txt index 6072dcd732..e963c1e627 100644 --- a/docs/ref/csrf.txt +++ b/docs/ref/csrf.txt @@ -152,7 +152,8 @@ class-based views<decorating-class-based-views>`. .. 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:: diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt index ba9bef7e6f..d899922dc1 100644 --- a/docs/ref/middleware.txt +++ b/docs/ref/middleware.txt @@ -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 :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 ------------------------------ |
