[mod_python] AuthHandler and Content-type

Peter van Kampen news at woody.datatailors.com
Mon Aug 30 21:55:11 EDT 2004


I have this configured apache like this:

<Directory /var/www/playground/test>
        SetHandler mod_python
	PythonAuthenHandler test
	PythonDebug On
	require valid-user

test.py is simply this:

from mod_python import apache

def authenhandler(req):
    req.user = ""
    return apache.OK
Finally there's a file: test.html in the same directory.

The problem is that now the content_type is text/plain. When I turn of
mod_python the content_type is text/html (as I want it to be).

I know I can set req.content_type = "text/html" but I want apache (or
mod_python) to do that for me... (because the files might not be only

Can I do that with mod_python? I noticed there is PythonTypeHandler but the
documentation is rather scarce.



Peter van Kampen
pterk -- at -- datatailors.com

More information about the Mod_python mailing list