Opened 18 years ago

Closed 18 years ago

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

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@…> 18 years ago.

Download all attachments as: .zip

Change History (4)

by Fredrik Lundh <fredrik@…>, 18 years ago

Attachment: urlconf.diff added

comment:1 by Fredrik Lundh <fredrik@…>, 18 years ago

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 by Fredrik Lundh <fredrik@…>, 18 years ago

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

comment:3 by Jacob, 18 years ago

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