Opened 22 months ago

Closed 21 months ago

Last modified 21 months 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: master
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 Changed 22 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 222460a994072dfae9d5ac6b22a2afb116f64b2a:

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

comment:2 Changed 22 months ago by Tim Graham <timograham@…>

In 61b685847e63e94d678988d6c7a8a7477b37275d:

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

Backport of 222460a994 from master

comment:3 Changed 22 months ago by Tim Graham <timograham@…>

In bb8a08794941ebc4fa5b575bf5dadad92d637dbe:

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

Backport of 222460a994 from master

comment:4 Changed 21 months ago by mjtamlyn

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution fixed deleted
  • Status changed from closed to new

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 Changed 21 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 77f6b468e5b3a389b3e56e1e1f70a56e8a0a68fa:

Fixed #21137 -- Corrected ULRconf include example.

Thanks marfire for the report.

comment:6 Changed 21 months ago by Tim Graham <timograham@…>

In de8715ca9749c182b3610ea3d1959c3a5603a919:

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

Thanks marfire for the report.

Backport of 77f6b468e5 from master

comment:7 Changed 21 months ago by Tim Graham <timograham@…>

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