Opened 19 years ago

Closed 18 years ago

Last modified 17 years ago

#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 Adrian Holovaty)

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)

app_root.diff (2.6 KB ) - added by jbowtie@… 19 years ago.
Makes request.app_root available to views

Download all attachments as: .zip

Change History (8)

comment:1 by Adrian Holovaty, 19 years ago

Description: modified (diff)
Summary: urlpatterns, incldue and app_rootGive views access to application root from urlconf

comment:2 by hugo, 19 years ago

see also #682 and #672

by jbowtie@…, 19 years ago

Attachment: app_root.diff added

Makes request.app_root available to views

comment:3 by jbowtie@…, 19 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 jbowtie@…, 19 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:5 by beginin, 18 years ago

Hello men. <a href=http://20six.co.uk/maps

my syte</a>

comment:6 by Chris Beaven, 18 years ago

Triage Stage: UnreviewedDesign 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 Malcolm Tredinnick, 18 years ago

Resolution: wontfix
Status: newclosed

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).

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