[mod_python] mod_python and .pyo files

Tobin Cataldo tcataldo at bham.lib.al.us
Thu Mar 8 12:39:59 EST 2007


Greetings,

I would like to ship only .pyo files to a website and use those with 
mod_python. I have seen this question in the archives but haven't seen a 
clear answer.

I believe the Python Interpreter will choose a .pyc or .pyo file if 
available, but I want to only have the .pyo files in my target directory.

Apache conf:
DirectoryIndex index.pyo index.py ...
...
AddHander mod_python .pyo
...
SetHandler mod_python

This Apache configuration still requires .py in the target directory or 
the page can't be found.

I am applying mod_python against a directory which Graham says will 
translate to a request against index.py 
(http://www.dscpl.com.au/wiki/ModPython/Articles/SetHandlerVersusAddHandler).

How do I overwrite this behavior? I suppose I could do it via Location 
directives, but how to do this with DirectoryIndex and the Directory 
directives?

Thanks,
Tobin Cataldo


More information about the Mod_python mailing list