Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3187 closed enhancement (fixed)

[patch] allow middleware to override the URL configuration

Reported by: Fredrik Lundh <fredrik@…> Owned by: adrian
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@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

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

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

  • Summary changed from allow middleware to override the URL configuration to ]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 8 years ago by Fredrik Lundh <fredrik@…>

  • Summary changed from ]patch] allow middleware to override the URL configuration to [patch] allow middleware to override the URL configuration

comment:3 Changed 8 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(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