Opened 9 years ago

Closed 9 years ago

Last modified 9 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


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.


Change History (3)

comment:1 Changed 9 years ago by Russell Keith-Magee

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 Changed 9 years ago by Russell Keith-Magee

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 Changed 9 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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