#66 closed defect (wontfix)
[patch] Give views access to application root from urlconf
| Reported by: | slashzero | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Core (Other) | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When using include with urlpatterns, there should be a variable available to the views that will give us the root of the application. For instance, for:
(r'^polls/', include('myproject.apps.polls.urls.polls')),
...it would be "/polls/".
Attachments (1)
Change History (8)
comment:1 by , 20 years ago
| Description: | modified (diff) |
|---|---|
| Summary: | urlpatterns, incldue and app_root → Give views access to application root from urlconf |
comment:2 by , 20 years ago
comment:3 by , 20 years ago
The attached patch is a trivial fix that constructs an app_root during URL resolution and attaches it to the request object.
comment:4 by , 20 years ago
| Summary: | Give views access to application root from urlconf → [patch] Give views access to application root from urlconf |
|---|
Adding [patch] to summary to flag it for review
comment:6 by , 19 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
The idea still intrigues me, but I'm not sure we need it since we have reverse url lookups now.
comment:7 by , 19 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Does not seem to be a use case for this that cannot be done in other ways (either by passing through the root as a captured parameter or using reverse URL lookups).
see also #682 and #672