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

sanket agarwal snktagarwal at gmail.com
Wed Mar 11 16:48:02 EDT 2009


It worked.
Thanx. I'll back with some more queries as soon as i encounter them. :-)

Sanket

On Thu, Mar 12, 2009 at 1:31 AM, Graham Dumpleton <
graham.dumpleton at gmail.com> wrote:

> 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20090312/20106858/attachment.html


More information about the Mod_python mailing list