Kaydet (Commit) 406de977 authored tarafından alexanderblnf's avatar alexanderblnf Kaydeden (comit) Tim Graham

Fixed #30161 -- Added how to decorate class-based views to view decorators docs.

üst d7765773
...@@ -307,6 +307,9 @@ decorator. In the example, ``never_cache()`` will process the request before ...@@ -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 ...@@ -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
==================== ====================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment