#15835: middleware.process_response(): TemplateResponse.render() isn't called
--------------------------------------+------------------------------
               Reporter:  wkornewald  |          Owner:  nobody
                   Type:  Bug         |         Status:  closed
              Milestone:              |      Component:  Core (Other)
                Version:  SVN         |       Severity:  Normal
             Resolution:  invalid     |       Keywords:
           Triage Stage:  Unreviewed  |      Has patch:  0
    Needs documentation:  0           |    Needs tests:  0
Patch needs improvement:  0           |  Easy pickings:  0
--------------------------------------+------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * easy:   => 0
 * needs_docs:   => 0
 * resolution:   => invalid


Comment:

 It think this works as designed.

 From http://docs.djangoproject.com/en/dev/ref/template-response/:

 <quote>

 There are three circumstances under which a !TemplateResponse will be
 rendered:

 - When the !TemplateResponse instance is explicitly rendered, using the
 !SimpleTemplateResponse.render() method.
 - When the content of the response is explicitly set by assigning
 response.content.
 - After passing through template response middleware, but before passing
 through response middleware.

 </quote>

 If you are using it in the response middleware, you bypass the third item
 which usually ensures that the rendering happens. You should call render()
 on the TemplateResponse object before returning it.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15835#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to