Django

Code

Ticket #66 (closed: wontfix)

Opened 3 years ago

Last modified 1 year ago

[patch] Give views access to application root from urlconf

Reported by: slashzero Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

app_root.diff (2.6 kB) - added by jbowtie@amathaine.com on 03/22/06 02:51:05.
Makes request.app_root available to views

Change History

07/18/05 15:54:51 changed by adrian

  • description changed.
  • summary changed from urlpatterns, incldue and app_root to Give views access to application root from urlconf.

11/06/05 05:41:59 changed by hugo

see also #682 and #672

03/22/06 02:51:05 changed by jbowtie@amathaine.com

  • attachment app_root.diff added.

Makes request.app_root available to views

03/22/06 04:32:01 changed by jbowtie@amathaine.com

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

04/23/06 22:56:19 changed by jbowtie@amathaine.com

  • 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

11/08/06 07:17:52 changed by beginin

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

>my syte</a>

02/11/07 17:31:44 changed by SmileyChris

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

03/09/07 05:59:02 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to wontfix.

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


Add/Change #66 ([patch] Give views access to application root from urlconf)




Change Properties
Action