There are instructions on how to do this in the
"[https://docs.djangoproject.com/en/2.1/topics/class-based-views/intro
/#decorating-class-based-views Decorating class-based views]" section of
the "Introduction to class-based views" part of the docs.
To me it seems reasonable to link to that section, or even include (part)
of it in the "View decorators" part of the docs.
Another minor note, the "Decorating class-based views" section has
instructions on how to apply the `login_required` decorator, but doesn't
mention the alternative `LoginRequiredMixin` which is only mentioned in
the "[https://docs.djangoproject.com/en/2.1/topics/auth/default/#the-
loginrequired-mixin Using the Django authentication system]" part of the
docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/30161>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/30161#comment:1>
* owner: nobody => Alexandru Balan
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30161#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/11075 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30161#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"406de977ea1a6429535d21240e3ecdac06d4516c" 406de977]:
{{{
#!CommitTicketReference repository=""
revision="406de977ea1a6429535d21240e3ecdac06d4516c"
Fixed #30161 -- Added how to decorate class-based views to view decorators
docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30161#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"14240e491e8e10f9627787d0ba9e76ac0bdf7371" 14240e4]:
{{{
#!CommitTicketReference repository=""
revision="14240e491e8e10f9627787d0ba9e76ac0bdf7371"
[2.2.x] Fixed #30161 -- Added how to decorate class-based views to view
decorators docs.
Backport of 406de977ea1a6429535d21240e3ecdac06d4516c from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30161#comment:5>