[mod_python] Mod Python problems

gOLeM aditya.vrr at gmail.com
Fri Apr 7 16:26:45 EDT 2006


sorry.. forgot to add that the mptest.py is located in /var/www/html/mptest.py

i did try creating a directory in /var/www/html/psp and also put the
same lines in .htaccess and tried to access
http://localhost/psp/mptest.py. and got the same problem. :(

On 4/7/06, gOLeM <aditya.vrr at gmail.com> wrote:
> Mod_python error: "PythonHandler mptest"
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.2/site-packages/mod_python/apache.py", line
> 287, in HandlerDispatch
>     log=debug)
>
>   File "/usr/lib/python2.2/site-packages/mod_python/apache.py", line
> 461, in import_module
>     f, p, d = imp.find_module(parts[i], path)
>
> ImportError: No module named mptest
>
> do i have to set any path?
> I am using the global apache configuration file /etc/httpd/conf/httpd.conf
> added the following lines to it
> ------------------------------------
> AddHandler python-program .py
> PythonHandler mptest
> PythonDebug On
> ------------------------------------
> mptest.py
> from mod_python import apache
>
> def handler(req):
>     req.content_type = 'text/plain'
>     req.send_http_header()
>     req.write('mptest.py\n')
>     return apache.OK
>
> using the latest version of mod-python, working on fedora core 1 with
> apache 2.0.4
>
>
>
> On 3/28/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
> > gOLeM wrote ..
> > > Hello,
> > >
> > > I know that you guys must have got this mail a thousand times, but i
> > > cant seem to find a solution anywhere. I have tried everything but
> > > couldnt get mod_python running.
> > >
> > > I've downloaded the psp_site.tgz and put it in /var/www/html/psp_site
> > > and when i try to access it, i am getting the actual code instead of
> > > the webpage.
> > > The mod_python.so is loaded, but still i am not able to get psp running
> > > :(
> > >
> > > Please help me.
> >
> > Have you tried getting a simple test handler going first? Trying to
> > start out by using PSP site example is not a good way to go.
> >
> > If you haven't tried a simple test handler first, work your way through:
> >
> >   http://www.dscpl.com.au/articles/modpython-001.html
> >
> > to get an idea how things work.
> >
> > If you have got a simple test handler going, you need to be a bit more
> > specific about what snippet of Apache configuration you are using
> > to enable PSP example. Where it is, ie., global Apache config or in
> > .htaccess file etc.
> >
> > Graham
> >
> >
>
>
> --
> The Purpose of Life is a life of purpose -- Leider, Richard
> Quitters never win and Winners never quit   -- Napolean Hill
>


--
The Purpose of Life is a life of purpose -- Leider, Richard
Quitters never win and Winners never quit   -- Napolean Hill



More information about the Mod_python mailing list