[mod_python] Re: Enhancements for better content negotiation

Deron Meranda deron.meranda at gmail.com
Mon Aug 21 14:27:18 EDT 2006

On 8/18/06, webograph <webograph at eml.cc> wrote:
> from my understanding, this mod_python would be the preferrable place to
> put such functions (even better, mod_python could use apache
> functionality for this, but i don't know enough about the interaction
> btwn apache and mod_python to say whether this is feasible or not)
>  > * Is this something that seems useful to others?
> absolutely yes! could you post it?

Sorry for the delay, I've been on vacation.

I had decided that all that code I wrote was best to be a standalone
python module (which I've called "httpheader.py") as it had more
appeal than just mod_python users.  I haven't touched it much since
the beginning of the year, but it is pretty well complete and tested, and
it is being used on some of my production systems daily.  You can
currently find a copy and documentation at


Note that it may seem quite complex at first, mainly because I've
attempted to make it 100% conforming to all the applicable RFCs,
and so it very strictly implements all the crazy BNF and other
syntax rules and rarely traveled corners of the HTTP protocol spec.

Also in addition to all the content negotiation stuff I had mentioned,
it also has a lot of support for HTTP byte range requests.  I
use that for example to serve up very large "files" directly from
database tables, while fully supporting resumed downloads, and even
random access as occurs with Acrobat for PDF documents for

I do think that perhaps at least some of this might be useful to
put into the mod_python utilities classes.  If anybody thinks so,
let me know and I'll help donate/integrate the changes (we'll probably
move discussions over to the mod_python dev mailing list if that

Feedback on my module would be appreciated.

(All this reminds me I've been neglecting my own website)
Deron Meranda

More information about the Mod_python mailing list