[mod_python] How do you use mod_python?

Daniel J. Popowich dpopowich at comcast.net
Fri Jan 20 09:02:57 EST 2006


Daniel Nogradi writes:
> Some time ago there was a post (I think by Grisha) asking "why are you
> using mod_python?". It would be interesting to see answers from many
> users to a related question, _how_ do you use mod_python?

I use mod_python as the low-level framework to write mpservlets.  I
now write all my web-apps with mpservlets.  I have used mpservlets for
projects large (I've written two content management systems with it)
and small (publishing the Cartoon of the Day to lighten the spirit for
my department).  Yes, I eat my own dog food, as someone else put it.

Why mpservlets?  This is best summed up from a section from
the README:

    ============
    1. Overview
    ============

    If mod_python's publisher handler is a functional view of
    the web, the servlet handler is an object oriented view of
    the web.  It is inspired by WebWare
    (http://webware.sourceforge.net).

    I programmed with WebWare for many projects.  I loved the
    object oriented view of the web it promoted and found it to
    be a very productive tool to quickly prototype web
    applications.  However, I found it lacking in a number of
    ways: 1) it has its own server process that needs to be
    started and managed, this is in addition to apache or
    another web server; 2) its class hierarchy is rather deep:
    there are five classes, inclusive, in the hierarchy between
    the base class and the class that represents an HTML page
    (there are only two in Mod_python Servlets); 3) even though
    a web server like apache manages processes and/or threads,
    WebWare has its own extensive thread management system which
    adds complexity to an overall web application; 4) WebWare
    promotes a comprehensive buy-in to their framework that,
    personally, I found unwieldy.

    In short, I found WebWare too "big" for my needs and started
    looking for something more streamlined.  I couldn't find it.

    Since I never intended on using a web server other than
    apache, it made sense to give mod_python a closer look than
    I had before.  It was immediately clear that process/thread
    management came "free" by using an apache handler.  The
    publisher handler is clearly a powerful tool, but I missed
    the OO view of WebWare.  I looked at mod_python handlers
    that are available in the opensource community, but found
    most required a buy-in to their framework and/or content
    management system.

    At some point I realized it would be VERY easy to implement
    the best features of WebWare as a mod_python handler without
    the bloat and management burdens of other systems.  Best of
    all, it would be easy to reuse many features of mod_python
    without re-inventing the wheel (Session, Cookie,
    FieldStorage, etc.)


Cheers,


Daniel Popowich
---------------
http://home.comcast.net/~d.popowich/mpservlets/


More information about the Mod_python mailing list