[mod_python] errors in default mod_python docs for 3.2.10 publisher setup

Blair P. Houghton blair at houghton.net
Thu Aug 31 22:01:48 EDT 2006

I happened to get frustrated enough to plug the right magic
into the right search box (the one at http://modpython.org/,
as Google wasn't helping) and found the answer to the reason
that /my/ publisher setup wasn't finding my scripts.  The answer
is that the setup I was following from the 3.2.10 doc tree is
incomplete, and doesn't say that the URI for a publisher-mediated
script has to include the name of the method being invoked.

I.e., this document is inadequate:


the three .conf lines are correct, but the description omits the
correct URI formula.  Just browsing to http://domain/path/script
or http://domain/path/script.py gets a 404 error, while
http://domain/path/script.py/handler works fine.  Note that the
'.py' suffix must be included also.

This document has a different .conf, but does give
the correct instructions for the URI:


Okay.  For grins I just tried the second .conf setup, and
now it works with or without the '.py' suffix, but the
handler name is still required.*

I have not tested any PATH environment-variable 
variations.  I do know that I have one installation 
(the XAMPP bundle on Win XP) that does not need any 
explicit Python elements in the PATH at all.  How that 
works I don't know.  But this one (the 
DeveloperSide.net bundle, with mod_python added on 
afterward...I forget whose mod_python build it was, I'm 
pretty sure I got it from a modpython.org mirror).

I believe that the document from the live/current tree 
should be moved to the document in the live/mod_python-
3.2.10 tree ASAP so that people won't be caught by this 
any more.  I'd do it myself but I'm not even sure that 
this email will get through so I'm not quite up to 
speed on monkeying around the project files, nor even 
if they're modifiable by mod_python newbs.  Another of 
the pleasures of open source.


* - here are the significant lines from the working .conf:

  LoadModule python_module modules/mod_python.so

  <Directory /www/webroot>
    SetHandler mod_python 
    PythonHandler mod_python.publisher

The path "modules/mod_python.so" is
relative to the Apache install directory; in this case
the full path is C:/www/Apache22/modules/mod_python.so".
"/www/webroot" is the base of my served-file tree, so it
could have been just "/" or the Directory lines could
be omitted entirely and the behavior is the same on my
system.  The working URI is "http://localhost/script/handler".

More information about the Mod_python mailing list