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