[mod_python] (no subject)

Graham Dumpleton graham.dumpleton at gmail.com
Wed Jul 18 00:47:46 EDT 2007


I told you to do something which was unrelated to the mptest.py file.
I asked you to add to your main Apache configuration file:

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

You should then have restarted Apache. When you access your web server
from a web browser using the URL /mpinfo, this should have the result
of triggering the special inbuilt mod_python handler called
mod_python.testhandler. The Location directive in this case has got
nothing to do with your files and directories that exists on disk, it
matches the URL directly. I wanted you to at least get this working so
I knew whether you knew enough about Apache configuration so that I
had some idea that my other instructions made any sense to you and
that you were following them correctly. This Location based test
handler check was a simple as I could get and wouldn't depend on other
things you could get wrong and not manage to correct such as file and
user permissions. If you weren't able to even get this going, then I'd
have to consider that I wasting my time until you went and actually
read the Apache documentation and learned how to configure and use
Apache, something which I still suggest you now go do.

Graham

On 18/07/07, ryan luna <ryan_gm at sbcglobal.net> wrote:
> /mpinfo is a .py file...meaning when i got to /mpinfo it shows the source
> code i thought iv made this clear -.-
>
> Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
>  If you don't understand what a Location directive is and that to
> access /mpinfo meant to access from it your web browser, I would very
> much suggest that before even trying to use mod_python that you learn
> something about Apache and configuring it first. I suggest starting
> with the following:
>
>  http://httpd.apache.org/docs/2.2/
>
> Without you having some understanding of Apache configuration we could
> go on forever suggesting you try certain things, yet never even be
> certain that you are doing it correctly, and probably never find a
> solution either.
>
> Graham
>
> On 18/07/07, ryan luna wrote:
> > You mean putting those lines to the httpd.conf and running the mpinfo.py?
> > If so this is what i get
> > Traceback (most recent call last):
> > File "C:\Scripts\mptest.py", line 1, in
> > from mod_python import apache
> > File
> > "C:\Python25\Lib\site-packages\mod_python\apache.py",
> line
> > 30, in
> > import _apache
> > ImportError: No module named _apache
> >
> > Graham Dumpleton wrote:
> > What happens if you use add this configuration:
> >
> >
> > SetHandler mod_python
> > PythonHandler mod_python.testhandler
> >
> >
> > Then access '/mpinfo'.
> >
> > Do you get lots of mod_python debug info?
> >
> > Graham.
> >
> > On 18/07/07, ryan luna wrote:
> > > I just tried that and theres no change.
> > > The fact that im using WAMP instead of straight up Apache wouldn't have
> > > anything to do with it would it?
> > >
> > > Graham Dumpleton wrote:
> > > Hmmm, you never mentioned you were on a Windows box.
> > >
> > > Did you try what was previously suggested of putting the mod_python
> > > configuration stuff in an appropriate Directory directive in your main
> > > Apache configuration file?
> > >
> > >
> > > PythonHandler mptest
> > > AddHandler mod_python .py
> > > PythonDebug On
> > >
> > >
> > > Graham
> > >
> > > On 18/07/07, ryan luna wrote:
> > > > Im running the latest python version, mod_python 3.3.1, and latest
> > Apache.
> > > > Heres my apache config file
> > > > http://www.megaupload.com/?d=OKNGKO7Q
> > > > Still having trouble figuring out why apache still shows the source
> code
> > > of
> > > > .py files instead of the code output.
> > > >
> > > > _______________________________________________
> > > > 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