#25472: docs of login_required() should show the usage in class-based-views.
-------------------------------------+-------------------------------------
     Reporter:  guettli              |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  1.8
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by guettli:

Old description:

> The docs of login_required() should show the usage in class-based-views.
>
> This pattern seems common:
>
> ```
> urlpatterns = [
>     url(r'^about/',
> login_required(TemplateView.as_view(template_name="secret.html"))),
> ```
> from: https://docs.djangoproject.com/en/1.8/topics/class-based-
> views/intro/#decorating-in-urlconf
>
> Please update the docs:
> https://docs.djangoproject.com/en/1.8/topics/auth/default/#django.contrib.auth.decorators.login_required
>
> Since class-based views are the default today, I think it would be
> appropriate to list the class-based-view way first, and then list the
> decorating of view-methods.

New description:

 The docs of login_required() should show the usage in class-based-views.

 This pattern seems common:

 {{{
 urlpatterns = [
     url(r'^about/',
 login_required(TemplateView.as_view(template_name="secret.html"))),
 }}}

 from: https://docs.djangoproject.com/en/1.8/topics/class-based-views/intro
 /#decorating-in-urlconf

 Please update the docs:
 
https://docs.djangoproject.com/en/1.8/topics/auth/default/#django.contrib.auth.decorators.login_required

 Since class-based views are the default today, I think it would be
 appropriate to list the class-based-view way first, and then list the
 decorating of view-methods.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/25472#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3f174164c69dc87be32295b40d559bac%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to