diff options
| author | Fabio Natali <fabio@fnstudio.it> | 2014-11-15 12:15:56 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-15 19:33:39 +0100 |
| commit | fa680ce1e252666d125264b2e93782c127ebe8c8 (patch) | |
| tree | c4d5103035a5a7c3269f57ea4333cc20d9730229 /docs | |
| parent | 1ed9b9e2e2b62f6ef89558f98d786e9fcd649152 (diff) | |
Fixed #23825 -- Added links for decorating class-based views to the CSRF docs.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/csrf.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/ref/csrf.txt b/docs/ref/csrf.txt index 9e682ec6ae..70d2019f65 100644 --- a/docs/ref/csrf.txt +++ b/docs/ref/csrf.txt @@ -205,6 +205,9 @@ both is fine, and will incur minimal overhead. # ... return render(request, "a_template.html", c) + If you are using class-based views, you can refer to + :ref:`Decorating class-based views<decorating-class-based-views>`. + Rejected requests ================= @@ -283,8 +286,10 @@ will require a CSRF token to be inserted you should use the @cache_page(60 * 15) @csrf_protect def my_view(request): - # ... + ... +If you are using class-based views, you can refer to :ref:`Decorating +class-based views<decorating-class-based-views>`. Testing ======= @@ -327,6 +332,10 @@ section. Utilities --------- +The examples below assume you are using function-based views. If you +are working with class-based views, you can refer to :ref:`Decorating +class-based views<decorating-class-based-views>`. + .. function:: csrf_exempt(view) This decorator marks a view as being exempt from the protection ensured by |
