[Django] #21137: Documentation example of how to use include and pattern lists to refactor urlconfs with repeated path prefixes

14 views
Skip to first unread message

Django

unread,
Sep 21, 2013, 11:42:37 AM9/21/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
--------------------------------------+--------------------
Reporter: debo | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
This was motivated by this gist by David Wolever:
https://gist.github.com/wolever/6603290#file-nested_urls-py

I've seen this antipattern in enough projects now that I thought it might
be nice to explicitly call it out in the docs.

I've made the doc edit in this branch:
https://github.com/MichaelDiBernardo/django/tree/add_urlconf_refactoring_example

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

Django

unread,
Sep 21, 2013, 6:18:09 PM9/21/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
----------------------------------+----------------------------
Reporter: debo | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
----------------------------------+----------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"222460a994072dfae9d5ac6b22a2afb116f64b2a"]:
{{{
#!CommitTicketReference repository=""
revision="222460a994072dfae9d5ac6b22a2afb116f64b2a"
Fixed #21137 -- Documented best practice for URLconfs with repeated
pattern prefixes.
}}}

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

Django

unread,
Sep 21, 2013, 6:19:02 PM9/21/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
----------------------------------+----------------------------
Reporter: debo | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
----------------------------------+----------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"61b685847e63e94d678988d6c7a8a7477b37275d"]:
{{{
#!CommitTicketReference repository=""
revision="61b685847e63e94d678988d6c7a8a7477b37275d"
[1.5.x] Fixed #21137 -- Documented best practice for URLconfs with
repeated pattern prefixes.

Backport of 222460a994 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21137#comment:2>

Django

unread,
Sep 21, 2013, 6:19:04 PM9/21/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
----------------------------------+----------------------------
Reporter: debo | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
----------------------------------+----------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"bb8a08794941ebc4fa5b575bf5dadad92d637dbe"]:
{{{
#!CommitTicketReference repository=""
revision="bb8a08794941ebc4fa5b575bf5dadad92d637dbe"
[1.6.x] Fixed #21137 -- Documented best practice for URLconfs with
repeated pattern prefixes.

Backport of 222460a994 from master
}}}

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

Django

unread,
Sep 24, 2013, 7:49:41 AM9/24/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
-------------------------------------+-------------------------------------
Reporter: debo | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* status: closed => new
* needs_better_patch: => 0
* resolution: fixed =>
* needs_tests: => 0
* needs_docs: => 0


Comment:

See comments on
https://github.com/django/django/commit/222460a994072dfae9d5ac6b22a2afb116f64b2a

I think the committed code has an error - the first argument to `patterns`
should be on the second call.

--
Ticket URL: <https://code.djangoproject.com/ticket/21137#comment:4>

Django

unread,
Sep 24, 2013, 9:41:34 AM9/24/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
-------------------------------------+-------------------------------------
Reporter: debo | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"77f6b468e5b3a389b3e56e1e1f70a56e8a0a68fa"]:
{{{
#!CommitTicketReference repository=""
revision="77f6b468e5b3a389b3e56e1e1f70a56e8a0a68fa"
Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21137#comment:5>

Django

unread,
Sep 24, 2013, 9:42:01 AM9/24/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
-------------------------------------+-------------------------------------
Reporter: debo | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"de8715ca9749c182b3610ea3d1959c3a5603a919"]:
{{{
#!CommitTicketReference repository=""
revision="de8715ca9749c182b3610ea3d1959c3a5603a919"
[1.5.x] Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

Backport of 77f6b468e5 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21137#comment:6>

Django

unread,
Sep 24, 2013, 9:42:03 AM9/24/13
to django-...@googlegroups.com
#21137: Documentation example of how to use include and pattern lists to refactor
urlconfs with repeated path prefixes
-------------------------------------+-------------------------------------
Reporter: debo | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d30d66b90728b8dc173c050c63c86e5af3ab7c40"]:
{{{
#!CommitTicketReference repository=""
revision="d30d66b90728b8dc173c050c63c86e5af3ab7c40"
[1.6.x] Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

Backport of 77f6b468e5 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21137#comment:7>

Reply all
Reply to author
Forward
0 new messages