[mod_python] Trouble getting mod_python to work

Graham Dumpleton grahamd at dscpl.com.au
Thu Apr 20 07:46:18 EDT 2006

The Apache setup may be that they disallow you to even have a .htaccess
file. Make sure they aren't using:

   AllowOverride None

Ensure they have at least:

   AllowOverride FileInfo

This was mentioned in the getting started document I referred you to:
   If instead of the string "mptest.py" you see the actual source code

   contained in the file, or your browser asks you to save the response

   to a file and that file contains the source code, the main Apache  

   may not be enabled so as to allow you to specify Apache handlers  
in a ".htaccess"

   file. To enable this facility, edit your main Apache configuration  
file and add in an

   appropriate location:

   <Directory /some/directory>
   AllowOverride FileInfo
   Replace "/some/directory" with the absolute pathname to the  
directory in which

   the ".htaccess" file is located. You will need to restart Apache  
before this

   configuration change takes affect.

In your case it is a .psp file and not a .py file, but same issue  


On 20/04/2006, at 12:40 AM, John Salerno wrote:

> Hi everyone. I wrote before about having some trouble getting
> mod_python set up on my server. I'm not the one doing it, but I've
> been in touch with the admins. Whenever I try to access a PSP page, it
> simply shows the HTML source code instead of properly running it. I
> thought maybe this had to do with incorrect use of handlers, but I
> don't know what to do about it. The htaccess file reads:
> AddHandler mod_python .psp
> PythonHandler mod_python.psp
> PythonDebug On
> At one point they had their own custom handlers in there, but they
> changed it back. Another thing they just tried was changing the
> httpd.conf file and it reads:
> #<IfDefine HAVE_PYTHON>
> LoadModule python_module      /usr/lib/apache/mod_python.so
>  #<IfDefine HAVE_PYTHON>
> #AddModule mod_python.c
> #</IfDefine>
> AddModule mod_python.c
>  <Directory "/var/www/html">
>  AddHandler mod_python .psp
> PythonHandler mod_python.psp
> PythonDebug On
>  </Directory>
> But this kind of stuff is beyond me. My only other experience with
> mod_python was easy, because it was properly set up and I only had to
> write PSP files. I don't know what else needs to be done here to get
> it working. Any help would be appreciated.
> Thanks,
> John
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list