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

Graham Dumpleton graham.dumpleton at gmail.com
Wed Mar 11 16:01:23 EDT 2009


Try some of the suggestions and debugging tips in:

  http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking

Graham

2009/3/12 sanket agarwal <snktagarwal at gmail.com>:
> 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
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>



More information about the Mod_python mailing list