diff options
| author | alexanderblnf <alexandru@g2g-online.nl> | 2019-03-11 11:17:50 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-03-12 13:33:52 -0400 |
| commit | 14240e491e8e10f9627787d0ba9e76ac0bdf7371 (patch) | |
| tree | 55354b1829a48514940bedd6b98c68dfa36af6b0 | |
| parent | 282961f553bfd9563ef64e47adbda9937b2344a6 (diff) | |
[2.2.x] Fixed #30161 -- Added how to decorate class-based views to view decorators docs.
Backport of 406de977ea1a6429535d21240e3ecdac06d4516c from master.
| -rw-r--r-- | docs/topics/class-based-views/intro.txt | 3 | ||||
| -rw-r--r-- | docs/topics/http/decorators.txt | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/docs/topics/class-based-views/intro.txt b/docs/topics/class-based-views/intro.txt index 8399b56041..b1212af585 100644 --- a/docs/topics/class-based-views/intro.txt +++ b/docs/topics/class-based-views/intro.txt @@ -307,6 +307,9 @@ decorator. In the example, ``never_cache()`` will process the request before ``login_required()``. In this example, every instance of ``ProtectedView`` will have login protection. +These examples use ``login_required``, however, the same behavior can be +obtained more simply using +:class:`~django.contrib.auth.mixins.LoginRequiredMixin`. .. note:: diff --git a/docs/topics/http/decorators.txt b/docs/topics/http/decorators.txt index 55676c4888..b5145919ab 100644 --- a/docs/topics/http/decorators.txt +++ b/docs/topics/http/decorators.txt @@ -7,6 +7,9 @@ View decorators Django provides several decorators that can be applied to views to support various HTTP features. +See :ref:`decorating-class-based-views` for how to use these decorators with +class-based views. + Allowed HTTP methods ==================== |
