mod_python opening a text file instead of showing it on the browser

sanket agarwal <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
apache 2.2.8
mod_py 3.3.1

I am having a problem in setting up mod python properly in my system. I wen
through the docs where it said about testing. I am facing a problem when I
access that script like : http://localhost/mptest.

Instead of showing up the Hello World! in the browser it tries to open it in
a text format, in mozilla it gives me an option to save it instead of
displaying it as a response.

My htttpd.conf is as follows:

<Location /mpinfo>
    SetHandler mod_python
    PythonHandler mod_python.testhandler
</Location>

<Directory /var/www/>
        AddHandler mod_python .py
        PythonHandler mptest
        PythonDebug On
</Directory>


And mpinfo is definitely showing up with lots of server info :)

My RootServer is /var/www
Python file is /var/www/mptest.py

the contents are

    from mod_python import apache

    def handler(req):
        req.content_type = 'text/plain'
        req.write("Hello World!")



        return apache.OK

 As told in the docs.

Please disambiguate this anomaly.!

_______________________________________________
Mod_python mailing list
[email protected]
http://mailman.modpython.org/mailman/listinfo/mod_python
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.