[mod_python] Future of mod_python

Graham Dumpleton graham.dumpleton at gmail.com
Fri Dec 5 18:01:23 EST 2008

2008/12/5 Bozhin Zafirov <bozhin.zafirov at gtvbg.tv>:
> Hi List, :-)
> Having in mind that the latest version of mod_python is 3.3.1, released
> Feb-14-2007 (according to modpython.org) - this makes the project to seem a
> bit stalled. Anyone with more inside look on this matter?

There is no one really actively working on code. I change stuff only
when absolutely required to address issues with it not compiling when
new versions of APR or other stuff is released and where mod_python
wasn't using API correctly, or where operating system changes require
updates, such as with MacOS X Leopard 64 bit support. These changes
only ever make it into subversion repository though. I have no time to
do more than this and am already stretching myself by continuing to
answer questions on this list.

> Will it continue to develop, or is it doomed to die?
> Also, now that python 3.0 is finally released (2 days ago, cheers!), will
> there be any efforts to make a new port of mod_python + python3?

No one has stepped up to say they are interested in porting it to
Python 3.0. Personally I think it is too much work and the changes
required to APIs, because of bytes/unicode separation, would be such
that everyone would have to change any applications which use it.
Also, there is already a significant list of issues with mod_python
that need to be fixed:


It would sort of be a bit ridiculous to consider trying a port to
Python 3.0 when there are so many issues unfixed.

> I would be very happy to see it going forward, it's a really wonderful piece
> of software!

Which aspect do you perceive as 'wonderful'? :-)

There are two parts to mod_python. There is the fact that it allows
Python web applications to be hosted on Apache, and there are the high
level handlers which provide a custom interface (pseudo web framework)
for writing web applications.

If you are not using the high level handlers nor mod_python specific
components, these days you would be better of re-factoring your web
application such that it runs against WSGI API. This will give you
more options for running your application, including on top of pure
Python web servers, or using FASTCGI/SCGI/AJP on top of Apache or
other web servers.

For Apache specifically, the best option these days is actually
mod_wsgi, which performs better than mod_python on speed and memory
fronts. The mod_wsgi module for Apache also has a daemon mode so it
can run web application in separate process, as another user if need
be, just like FASTCGI/SCGI/AJP solutions. The module also still
provides ability to define authentication providers in Python code,
with a much arguably cleaner interface at that. Also can deal with
authorization in Python code as well.

If your application is written specifically to mod_python component
APIs, then you have a bigger problem as would be more significant work
to move to WSGI. It is technically possible that some of the high
level handlers stuff of mod_python could be moved to WSGI, but the API
applications would still need to change and there are much better
options as far as other toolkits or frameworks available for WSGI that
you really should use instead.

Overall, I wouldn't hold your breath waiting for mod_python to be
ported to Python 3.0. Even if done your application would also need to
be changed and not just because of Python 3.0 language/modules
changes, but at the interface to mod_python. You would thus perhaps
want to be considering moving to hosting on top of WSGI interface
instead. This will give you portability to other hosting solutions, as
well as still being able to run it on Apache using mod_wsgi, which has
already been ported to Python 3.0, albeit you have to use code out of
subversion repository for mod_wsgi for now if want to use it with
Python 3.0.

The question thus is, which bits of mod_python are you dependent upon?


More information about the Mod_python mailing list