Fixed #30161 -- Added how to decorate class-based views to view decorators docs.
This commit is contained in:
parent
d77657737f
commit
406de977ea
|
@ -307,6 +307,9 @@ decorator. In the example, ``never_cache()`` will process the request before
|
||||||
``login_required()``.
|
``login_required()``.
|
||||||
|
|
||||||
In this example, every instance of ``ProtectedView`` will have login protection.
|
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::
|
.. note::
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,9 @@ View decorators
|
||||||
Django provides several decorators that can be applied to views to support
|
Django provides several decorators that can be applied to views to support
|
||||||
various HTTP features.
|
various HTTP features.
|
||||||
|
|
||||||
|
See :ref:`decorating-class-based-views` for how to use these decorators with
|
||||||
|
class-based views.
|
||||||
|
|
||||||
Allowed HTTP methods
|
Allowed HTTP methods
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue