[Django] #25472: docs for

3 views
Skip to first unread message

Django

unread,
Sep 26, 2015, 12:17:09 PM9/26/15
to django-...@googlegroups.com
#25472: docs for
--------------------------------------+--------------------
Reporter: guettli | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
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>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 26, 2015, 12:17:43 PM9/26/15
to django-...@googlegroups.com
#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
-------------------------------------+-------------------------------------
Changes (by guettli):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/25472#comment:1>

Django

unread,
Sep 26, 2015, 12:18:21 PM9/26/15
to django-...@googlegroups.com
#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

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

unread,
Sep 26, 2015, 2:05:06 PM9/26/15
to django-...@googlegroups.com
#25472: docs of login_required() should show the usage in class-based-views.
-------------------------------------+-------------------------------------
Reporter: guettli | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.8
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix


Comment:

Thanks for the suggestion. On Django 1.9, you can use the
`LoginRequiredMixin` instead and this is documented after the
`login_required()` decorator in that documentation. I don't think the
issue is critical enough that we need to patch the docs for 1.8.

--
Ticket URL: <https://code.djangoproject.com/ticket/25472#comment:3>

Reply all
Reply to author
Forward
0 new messages