Sure, absolutely. Lets assume I've quickstarted an app into a directory
corresponding with $TG_MP. And, as always, YMMV.

Go grab the mpcp.py from http://www.jamwt.com/ and put it into $TG_MP.
Ideally, you could just grab it from easy_install, but I had a problem
getting the mpcp to be seen in mod_python's $PYTHONPATH so that was my
workaround.

Put an .htaccess file in $TG_MP with the following:
--
SetHandler mod_python
PythonHandler mpcp
PythonDebug On
PythonOption cherrysetup [ $NAME_OF_YOUR_START_SCRIPT]::mp_setup
--
Warning! The start script is usually MyAppName-start.py, and the dash
will screw up the PythonOption. Ergo, lose the dash and there shouldn't
be any problems.

Now, in your (newly renamed) MyAppName_start.py make the following
changes:

1) move cherrypy.server.start() so it only starts if __name__ ==
"__main__". This might be unnecessary, but I really enjoy typing, so
whatever.

if __name__ == "__main__":
   cherrypy.server.start()

2) create a new no-op method, called mp_setup().  As such:
def mp_setup():
   pass

This method is supposed to have cherrypy production config stuff, but
our prod.cfg file handles that, so make it a no-op. The better solution
would be to remove the line in mpcp that looks for cherrysetup, but
that's something I'll worry about when a push to production is near.

Now give it a go, and let us know what happens.

Reply via email to