[mod_python] FW: Mod_Python

Jed Drury -X (jedrury - Manpower at Cisco) jedrury at cisco.com
Thu Jul 26 09:12:16 EDT 2007

Hi Jim,
Thanks for getting back to me so promptly.  The problem is that when I try
to test mptest.py there is no identification of mod apache.  I know that I'm
close to solving this problem.  However, there is something that I'm
Jed Drury 

-----Original Message-----
From: Jim Gallacher [mailto:jpg at jgassociates.ca] 
Sent: Thursday, July 26, 2007 9:05 AM
To: jedrury at cisco.com
Cc: mod_python at modpython.org
Subject: Re: [mod_python] FW: Mod_Python


According to your httpd error.log, mod_python is loading properly.

Jed Drury -X (jedrury - Manpower at Cisco) wrote:
> -----Original Message-----
> From: jed drury [mailto:jeddrury at yahoo.com]
> Sent: Thursday, July 26, 2007 5:14 AM
> To: jedrury at cisco.com
> Subject: Mod_Python
> Hello Graham,
> Thanks for your assistance.  The absolute path to where my mod_python 
> is installed is c:\Python25 or C:\Apache Group\Apache2.2\modules.  
> From what I've seen, it is installed on my system.  My main problems 
> are just configuring the httpd.conf file so that I don't always get 
> the
> "Traceback (most recent call last):
>   File "C:\Python25\mptest.py", line 1, in <module>
>     from mod_python import apache
>   File
> "C:\Python25\Lib\site-packages\mod_python\apache.py",
> line 30, in <module>
>     import _apache
> ImportError: No module named _apache"

I'll bet this is from a command line interpreter, right? You can't run
mod_python from the command line, only from within the apache httpd server.

> errors every time I try to run the mptest.py.
> I even tried to create the .htaccess file with "AddHandler 
> python-program .py PythonHandler mptest PythonDebug On" but to no avail.

Is .htaccess even being read? Make sure you have something like the
following in your httpd.conf:

<Directory /some/directory/htdocs/test>
    AllowOverride FileInfo

You could also stick:

AddHandler mod_python .py
PythonHandler mptest
PythonDebug On

in there as well, but while you're experimenting it's likely easier to put
these directives in your .htaccess file.


More information about the Mod_python mailing list