mod_python confusion

David Fraser davidf at sjsoft.com
Mon May 31 13:06:44 EDT 2004


Kylotan wrote:
> I thought mod_python would be the answer to my CGI performance issue,
> but I can't seem to make much sense out of it. All the examples are
> too trivial to be of much use.
> 
> Given that I have an application consisting of several CGI scripts,
> what is the simplest way to go about converting it to run on
> mod_python, not using the CGI-handler which is allegedly slow and
> buggy? Everything seems to suggest a major rewrite because I not only
> need to shift from printing everything to calling req.write or
> whatever, but I may also need to sort out some sort of dispatching
> mechanism mapping URLs to functions if I use mod_python directly. 

Basically the main performance gains from using mod_python are that you 
are calling functions in an already loaded program, rather than running 
a separate script each time (and the interpreter as well). So it 
generally does require a redesign. But if you refactor your code step by 
step this is usually achievable.

 > PSP
> doesn't work on my system as 3.1.2 gives me errors and the Win32
> installer for 3.1.3 fails at the last step (finding the Apache
> directory in the registry or something).
> 

There is a new win32 installer at 
http://davidf.sjsoft.com/files/mod_python-3.1.3-1.win32-py2.3.exe which 
should fix the issue (ask here or email me or see the mod_python list 
for more information)

David



More information about the Python-list mailing list