[mod_python] Wrapping a CGI script

Michael C. Neel neel at mediapulse.com
Tue Feb 10 11:16:49 EST 2004

My emails are going into an abyss atm, so if this double posts I

Okay, so lets say I have a collection of sites that share one forum app
(in my case iKonboard).  Each site has a different design template
generated by my application based on the site name from the client.
iKonboard is perl, my app python.  I don't want to write yet another bbs
and actually iKonbaord has several features in use so the time it would
take to recreate is too much.  It is however cgi, which got me

What would be the best approach to wrapping a cgi script?  I'm thinking
the basic flow would need to be:

python handler reads request from client
python handler sets up env space
python handler exec's cgi script
cgi scrpit acts as normal
python handler catches stdout
python handler parses and updates headers
python handler call app to skin board
result sent to client.

I'm thinking this will work, but I'm not quite sure how to setup the CGI
env space (really not a mod_python issue, more a python issue, but
mod_python may offer some help here).  There also may be another
approach I haven't thought of, besides Apache 2 handler chains (since I
don't have access to apache 2 for this site).


More information about the Mod_python mailing list