Opened 3 years ago

Closed 3 years ago

#33423 closed New feature (wontfix)

Load urls from function in URLResolver

Reported by: William Owned by: nobody
Component: Core (URLs) Version: 4.0
Severity: Normal Keywords: urls
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by William)

Instead of immediately raising an error if the urlpatterns in the loaded module is not a list, it would instead check if there is a
get_urls function in the module and call it. If there is no such function or it returns something other then a list raise the error, if it returns a list then use that instead of raising an error.

PR

Change History (2)

comment:1 by William, 3 years ago

Description: modified (diff)
Has patch: set

comment:2 by Mariusz Felisiak, 3 years ago

Resolution: wontfix
Status: newclosed

Thanks for this proposition, however I don't think it's common enough to create URLs at runtime. As far as I'm aware, in other cases function should not be necessary.

Please first start a discussion on the DevelopersMailingList, where you'll reach a wider audience and see what other think, and follow the guidelines with regards to requesting features. Don't forget to explain your use case.

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