[mod_python] mod_python proposal

Dustin Mitchell dustin at ywlcs.org
Fri Jun 13 15:34:59 EST 2003

I've been thinking a lot about the extensibility requirements of mod_python
users, in light of recent discussion.  Basically, the degree of flexibility
desired of mod_python is the same degree of flexibility delivered by Apache

To explain in more detail, most of the low-level frameworks people have been
discussing here would be /best/ implemented as an Apache module -- best in
terms of speed, flexibility, configurability, and installability.  In fact,
mod_psp is an Apache module.

mod_python's raison d'etre is to allow Apache modules to be written in
Python.  However, it's grown somewhat beyond that in extent, while also
omitting a few capabilities of native C modules.  My proposal is to separate
and enhance the mod_python core so that it supports the full functionality of
a C module, and no more.  The project would then reference other Apache
modules, coded fully in Python, which implement specific capabilities.  It
would probably also be helpful for mod_python to include some utility
functionality, e.g., query processing, html quoting, etc.

To bring it down to the level of configuration files, I'd like to have this
in my Apache config:

LoadModule python_module /path/to/mod_python.so
# Parallel to LoadModule, but they're written in Python!
LoadPythonModule mod_psp /path/to/mod_psp.py
LoadPythonModule publisher_module /path/to/publisher.py

# and act just like other Apache modules
AddHandler psp-script .psp

<VirtualHost ...>
  SetHandler publisher # references publisher_module above
  # publisher module defines its own Apache configs
  PublisherRoot /path/path/path

I don't know how possible this is in the specifics, although I think it will
make an interesting project.  As a general design scheme, what do you think?



  Dustin Mitchell
  dustin at ywlcs.org/djmitche at alumni.uchicago.edu

More information about the Mod_python mailing list