mod_python support for MoinMoin

/!\ this is all inside MoinMoin 1.2 release

I have begun working on integrating mod_python into request.py (moin--main branch). But I have suspended work on it as mod_python doesn't work with python2.3 yet - so I wait for release 3.1 of it. -- ThomasWaldmann 2003-11-02 20:38:56

At what handler do you aim? mod_python Performance shows that we should try to make a native handler implementation if we want to go for speed. The publisher will be hardest to implement, because of the path traversal (similar to Zope and Bobo), which MoinMoin does not have. cgipublisher is the easiest, but also the slowest implementation. -- OliverGraf 2004-01-05 08:57:00

The native PythonHandler directive of mod_python should be fairly easy to implement, too. I'll see if I can get one running. Lets see if it can beat FastCGI... ( see PerformanceProposals) -- OliverGraf 2004-01-05 09:06:00


Class traversal of current (3.1.2b, 3.0.4, 2.7.10) modpy is broken. See HelpOnInstalling/ApacheWithModPython for a workaround.

The bug seems to be fixed in mod_python cvs head.

With this patch we can use the RequestModPy directly from PythonHandler directive. Example:

.htaccess

SetHandler mod_python
PythonHandler test::Test.run

test.py

from mod_python import apache

class Test:
  def __init__(self, req):
    self.req=req
  def run(self, req):
    self.req.content_type = "text/plain"
    self.req.write("Hello World!")
    return apache.OK

So using MoinMoin with mod_python could be as easy as:

SetHandler mod_python
PythonPath "['/path/to/moin/moin/lib/python','/path/to/moin/moin/config']+sys.path"
PythonHandler MoinMoin.request::RequestModPy.run

-- OliverGraf 2004-01-05 10:22:00


Patch against moin--main--1.2 which gets modpy via PythonHandler working.

BTW: Quick benchmark shows nearly identical speed to FastCGI, but much higher load (2 vs 25)

Tested with cgi, fastcgi, Twisted and modpy. Plus the two new files for wiki/cgi-bin/ as extra files.

TODO

MoinMoin: MoinMoinTodo/Release 1.2/ModPython (last edited 2007-10-29 19:07:43 by localhost)