Warning : These instructions are meant to be followed if you are using mod_python 3.x or later. If you are using mod_python 2.7.x (namely, if you are using Apache 1.3.x), please refer to the proper documentation.
<Directory>
tag below (the directory then becomes the one in
which the .htaccess file is located), and you will need to
make sure the AllowOverride
directive applicable to this
directory has at least FileInfo
specified. (The default is
None
, which will not work.)
<Directory /some/directory/htdocs/test> AddHandler mod_python .py PythonHandler mptest PythonDebug On </Directory>
(Substitute /some/directory above for something applicable to your system, usually your Apache ServerRoot)
from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write("Hello World!") return apache.OK
See Also: