[mod_python] Stylesheets

Graham Dumpleton grahamd at dscpl.com.au
Tue Mar 28 02:46:44 EST 2006

On 28/03/2006, at 5:38 PM, Albert Leibbrandt wrote:

> Hi
> I've configure my apache to use mod_python and it works correctly.  
> My problem comes in when I try to access a stylesheet from the  
> html, it simply refuses to apply the styles.
> When I move the style sheet outside of the directory specified in  
> the virtual host it works, it would seem that python is trying to  
> execute everything in the directory?
> Have you guys got any advice, I have attached the virtual host  
> configuration:
> <VirtualHost test>
>    ServerAdmin test at test.test
>    DocumentRoot /www/test.chimeara
>    DirectoryIndex index
>    ServerName test.chimeara
>    ErrorLog /www/logs/test.chimeara.error_log
>    CustomLog /www/logs/test.chimeara.access_log common
>    <Directory>
>        SetHandler mod_python
>        PythonHandler mod_python.publisher
>        PythonDebug On

Add here:

   <Files *.css>
   SetHandler None

>    </Directory>
> </VirtualHost>

The SetHandler directive means to pass every request against  
directory through
mod_python. You thus have to undo this for *.css files, or use  
AddHandler with
a specific extension rather than SetHandler for mod_python stuff.

You might like to do some research of difference between AddHandler and


More information about the Mod_python mailing list