Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21137 closed Cleanup/optimization (fixed)

Documentation example of how to use include and pattern lists to refactor urlconfs with repeated path prefixes

Reported by: debo Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (7)

comment:1 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 222460a994072dfae9d5ac6b22a2afb116f64b2a:

Fixed #21137 -- Documented best practice for URLconfs with repeated pattern prefixes.

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

In 61b685847e63e94d678988d6c7a8a7477b37275d:

[1.5.x] Fixed #21137 -- Documented best practice for URLconfs with repeated pattern prefixes.

Backport of 222460a994 from master

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

In bb8a08794941ebc4fa5b575bf5dadad92d637dbe:

[1.6.x] Fixed #21137 -- Documented best practice for URLconfs with repeated pattern prefixes.

Backport of 222460a994 from master

comment:4 by Marc Tamlyn, 11 years ago

Resolution: fixed
Status: closednew

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.

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 77f6b468e5b3a389b3e56e1e1f70a56e8a0a68fa:

Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

comment:6 by Tim Graham <timograham@…>, 11 years ago

In de8715ca9749c182b3610ea3d1959c3a5603a919:

[1.5.x] Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

Backport of 77f6b468e5 from master

comment:7 by Tim Graham <timograham@…>, 11 years ago

In d30d66b90728b8dc173c050c63c86e5af3ab7c40:

[1.6.x] Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

Backport of 77f6b468e5 from master

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