Opened 3 years ago
Last modified 3 years ago
#26661 new Cleanup/optimization
Why not using AppConfig's name attribute instead of app_name in urls.py?
Reported by: | john-bonachon | Owned by: | nobody |
---|---|---|---|
Component: | Core (URLs) | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Marten Kenbeek | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In Django 1.9 you can namespace your urls by adding app_name
in urls.py
If the name will (generally) be the same as the containing module app, why not just call it like that, or at least reusing the AppConfig name attribute from apps.py?
Am I missing something? That's confusing when you are reading the tutorial for the first time.
Change History (4)
comment:1 Changed 3 years ago by
Cc: | Marten Kenbeek added |
---|
comment:2 follow-up: 3 Changed 3 years ago by
Component: | Core (Other) → Core (URLs) |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
We might end up changing the ticket to a documentation issue to explain the design.
comment:3 Changed 3 years ago by
Replying to timgraham:
We might end up changing the ticket to a documentation issue to explain the design.
Oh.. no interest in reusing the app name?
comment:4 Changed 3 years ago by
I said "might" because I cannot recall the original design discussion and say for certain whether or not the idea is a good one or is feasible to implement.
I seems to remember discussing this during the development of this feature (#21927) but I'm not certain. Marten, do you recall?