Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#66 closed defect (wontfix)

[patch] Give views access to application root from urlconf

Reported by: slashzero Owned by: adrian
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)

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by adrian

  • Description modified (diff)
  • Summary changed from urlpatterns, incldue and app_root to Give views access to application root from urlconf

comment:2 Changed 9 years ago by hugo

see also #682 and #672

Changed 9 years ago by jbowtie@…

Makes request.app_root available to views

comment:3 Changed 9 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 9 years ago by jbowtie@…

  • Summary changed from Give views access to application root from urlconf to [patch] Give views access to application root from urlconf

Adding [patch] to summary to flag it for review

comment:5 Changed 8 years ago by beginin

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

my syte</a>

comment:6 Changed 8 years ago by SmileyChris

  • Triage Stage changed from Unreviewed to 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 Changed 8 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to 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).

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