position of deferred rendering code

56 views
Skip to first unread message

Aryeh Leib Taurog

unread,
Jul 3, 2014, 1:59:49 PM7/3/14
to django-d...@googlegroups.com
I have a small app for logging errors to the database:
<https://pypi.python.org/pypi/django-shoogie>

I just moved the logging mechanism from middleware to a logging
handler because the deferred rendering of TemplateResponse objects is
'outside' the exception handling middleware.

I'm just curious, was that done intentionally? If so, what was the
rationale? It seems a bit asymmetric that the deferred rendering is
done after exception handling middleware runs, but before the response
middleware. The only benefit I could think of is that this way the
exception handling middleware can itself return a TemplateResponse
object. Is that something actually done in practice?

Thanks,
Aryeh Leib Taurog
Reply all
Reply to author
Forward
0 new messages