are there any examples on how to use Deliverance as a middleware [1] into Django?
Thanks, SimO
[1] http://packages.python.org/Deliverance/modules/middleware.html
are there any examples on how to use Deliverance as a middleware [1] into Django?
Thanks, SimO
[1] http://packages.python.org/Deliverance/modules/middleware.html
Unfortunately it's not easy, because Deliverance's internals rely heavily on WSGI and WebOb, so there's no straightforward way to transform a Django Response.
Your best bet is transforming the response after it leaves Django entirely. One way to do that is http-proxying to Django with
deliverance-proxy. Another is hooking up Deliverance as a WSGI middleware. For example, if you're running Django with mod_wsgi, something like this might work in your .wsgi file: