Opened 11 years ago

Closed 10 years ago

Last modified 9 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: UI/UX:

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@… 11 years ago.
Makes request.app_root available to views

Download all attachments as: .zip

Change History (8)

comment:1 Changed 11 years ago by Adrian Holovaty

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

comment:2 Changed 11 years ago by hugo

see also #682 and #672

Changed 11 years ago by jbowtie@…

Attachment: app_root.diff added

Makes request.app_root available to views

comment:3 Changed 11 years ago by jbowtie@…

The attached patch is a trivial fix that constructs an app_root during URL resolution and attaches it to the request object.

comment:4 Changed 10 years ago by jbowtie@…

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 Changed 10 years ago by beginin

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

my syte</a>

comment:6 Changed 10 years ago by Chris Beaven

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 Changed 10 years ago by Malcolm Tredinnick

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