Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25525 closed Uncategorized (fixed)

Docstring in default urls.py file uses `include()` without mentionning where to import it from

Reported by: Baptiste Mispelon Owned by: nobody
Component: Core (Other) Version: 1.9a1
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

1e82094f1b6690018228e688303295f83e1c3d9a removed the need for include to be imported in the default urls.py file but the instructions in the docstring of that module still make use of it [1].

From what I understand, the list could now be:

1. Add an import:  from blog import urls as blog_urls
2. Add a URL to urlpatterns:  url(r'^blog/', blog_urls)

[1] https://github.com/django/django/blob/master/django/conf/project_template/project_name/urls.py#L14

Change History (3)

comment:1 by Baptiste Mispelon, 9 years ago

Summary: Default urls.py documents an unnecessary use of `include()`Docstring in default urls.py file uses `include()` without mentionning where to import it from

Hmm, it seems like I misunderstood the new feature...

The include() is still very much necessary so I think we should just document where to import it from:

1. Add an import:  from blog import urls as blog_urls
2. Import the include function: from django.conf.urls import url, include
3. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))

comment:2 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 7ce6b10:

Fixed #25525 -- Added instructions about importing include() in urls.py

comment:3 by Tim Graham <timograham@…>, 9 years ago

In 8a987254:

[1.9.x] Fixed #25525 -- Added instructions about importing include() in urls.py

Backport of 7ce6b10e9464995a038289e00169ffa85d29e3a5 from master

Note: See TracTickets for help on using tickets.
Back to Top