Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#15083 closed (fixed)

TemplateResponse doesn't use custom per-request URLConf

Reported by: Russell Keith-Magee Owned by: nobody
Component: Generic views Version: 1.2
Severity: Keywords: blocker
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

via Sayane on django-dev mailing list:

There is a problem with TemplateResponse and request.urlconf. Custom urlconf is removed[1] before TemplateResponse is rendered. This means that any call to reverse() when rendering template will use default urlconf (from settings). This makes TemplateResponse useless when using custom urlconf.

[1] http://code.djangoproject.com/browser/django/trunk/django/core/handlers/base.py#L166

Change History (3)

comment:1 by Russell Keith-Magee, 13 years ago

Triage Stage: UnreviewedAccepted

I suspect the fix here will be to reorganize the logic so that the TemplateResponse is rendered before the URLConf is reset.

comment:2 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

(In [15226]) Fixed #15083 -- Corrected the order of TemplateResponse middleware handling, ensuring that custom URLConfs are valid, and that ResponseMiddleware is invoked if the TemplateResponseMiddleware causes errors. Thanks to Sayane for the report.

comment:3 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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