[mod_python] mod_python.publisher and MultiViews

Graham Dumpleton grahamd at dscpl.com.au
Fri Aug 12 02:56:36 EDT 2005


Yipee, found the required magic. Instead of:

>   AddHandler mod_python .py
>   PythonHandler mod_python.publisher
>   PythonDebug On
> 
>   Options +MultiViews
>   MultiviewsMatch Handlers

Extend it to use:

  AddHandler mod_python .py
  PythonHandler mod_python.publisher
  PythonDebug On

  Options +MultiViews
  MultiviewsMatch Handlers

  AddType text/html;qs=1.0 .py
  AddType text/html;qs=0.9 .html
  AddType text/plain;qs=0.8 .txt

Ie., one can use AddType to indicate that ".py" file is "text/html" and
then overridde the quality factor multiplier for other extension types
that you might have in the directory which share a common basename.
This will therefore give you more control over the content negotiation
process and allows you to direct a request for a resource without an
extension to the handler, in preference to a static file being served up.

Hope this is of use to others.

Enough of this Friday afternoon diversion. :-)

Graham


More information about the Mod_python mailing list