Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#3187 closed enhancement (fixed)

[patch] allow middleware to override the URL configuration

Reported by: Fredrik Lundh <fredrik@…> Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Here's a simple patch that lets you use different URL configurations for each request. This allows you to use middleware components to switch between different configurations based on hostname:

http://effbot.org/zone/django-multihost.htm

or otherwise provide different views of the site, based on some characteristic of the request.

Attachments (1)

urlconf.diff (684 bytes) - added by Fredrik Lundh <fredrik@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by Fredrik Lundh <fredrik@…>

Attachment: urlconf.diff added

comment:1 Changed 10 years ago by Fredrik Lundh <fredrik@…>

Summary: allow middleware to override the URL configuration]patch] allow middleware to override the URL configuration

(adding an urlconf class attribute to the Request base class would also be a good idea, of course)

comment:2 Changed 10 years ago by Fredrik Lundh <fredrik@…>

Summary: ]patch] allow middleware to override the URL configuration[patch] allow middleware to override the URL configuration

comment:3 Changed 10 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [4237]) Fixed #3187 -- Django will now look for the root URLconf as an attribute of the request object, if available. This lets middleware override the urlconf as needed. Thanks, Fredrik Lundh.

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