[mod_python] changing publisher `content' before sent to client

Graham Dumpleton grahamd at dscpl.com.au
Tue Jan 16 15:58:52 EST 2007

Jorey Bump wrote ..
> Jaime Wyant wrote:
> > In the end, I guess there is no way to intercept the `req.write' call
> > before the publisher makes it.
> There probably is. There is also an external module that might work for
> you:
>   http://mod-replace.sourceforge.net/
> Graham's discussed adding filter support to mod_python, as well, but I
> don't know how usable it is at the moment.

Using a mod_python output filter is certainly another choice, it can be
used to do the same thing as mod_replace, you just need to code what
you want done yourself. For getting something done quickly, you might
be better off using mod_replace as suggested since you just have to
install it and configure it.

If still interested in doing it using mod_python, look up output filters in
the mod_python documentation. There have also been past discussions
on the mailing list about output filters with examples, for example:


Thus, use the search box on mod_python site to search through past
discussions on output filters.


More information about the Mod_python mailing list