[mod_python] leopard - no interpret

Graham Dumpleton graham.dumpleton at gmail.com
Sat Jan 12 02:46:37 EST 2008


On 12/01/2008, dudley ackerman <rdacker at pacbell.net> wrote:
>
> On Jan 11, 2008, at 10:29 PM, Graham Dumpleton wrote:
>
> > On 12/01/2008, dudley ackerman <rdacker at pacbell.net> wrote:
> >>
> >> On Jan 11, 2008, at 9:58 PM, Graham Dumpleton wrote:
> >>
> >>> On 12/01/2008, dudley ackerman <rdacker at pacbell.net> wrote:
> >>>>
> >>>> On Jan 11, 2008, at 9:36 PM, Graham Dumpleton wrote:
> >>>>
> >>>>> Have you tried a basic mod_python handler first rather than trying
> >>>>> to
> >>>>> get publisher working? See:
> >>>>>
> >>>>> http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking
> >>>>>
> >>>>> for suggested path to at least getting basic handler working
> >>>>> first.
> >>>>>
> >>>>> Graham
> >>>>
> >>>> yes - i get the same behavior -- a text dump of the file
> >>>> - unless i end the url with a slash - then i get 'not found'.
> >>>
> >>> Have you followed all the suggestions in that document in regard to
> >>> validating that mod_python is loaded by checking the Apache error
> >>> logs? Have you tried the .htaccess method described in that
> >>> document?
> >>>
> >>> Have you independently from that document tried setting up
> >>> mod_python.testhandler as described in mod_python documentation to
> >>> also confirm that the server you are talking to actually has
> >>> mod_python loaded?
> >>>
> >>> Just work through that document step by step and when something
> >>> doesn't do what the document says should happen and you have tried
> >>> all
> >>> the suggestions in that document, then come back and say exactly
> >>> where
> >>> in the procedure in that document you got up to and explain what you
> >>> tried in order to debug it.
> >>>
> >>> Graham
> >>
> >> before i begin the beguine, could anyone possibly mention if this
> >> symptom has every been seen?
> >
> > Yes.
> >
> >> and if so, is there a known cause for it?
> >
> > Incorrect Apache configuration. Apache doesn't appear to know that it
> > should be treating the file with .py as special and routing it through
> > mod_python.
> >
> >> and if so, is there a known cure?
> >
> > Fix the configuration.
> >
> > If the answer was more obvious then I would have said so. All we can
> > do is get you to follow a known series of steps to try and get
> > something working, otherwise we would need psychic powers to know what
> > is wrong.
> >
> > Graham
>
> ok. after a restart, i don't see:
> Tue Feb 01 16:09:32 2005] [notice] mod_python: (Re)importing module
> 'mptest'
>
> is there someplace in my httpd.conf i might look for the problem?

You will not see that immediately after a restart, you would only
expect to see mod_python mentioned in the server startup string. For
example:

[Tue Feb 01 16:08:21 2005] [notice] Apache/2.0.51 (Unix)
  mod_python/3.1.3 Python/2.3 configured -- resuming normal operations

Are you seeing that for a start?

The line about importing would only occur the first time that you make
a request against the URL which would target that file.

Let us know if you see the startup string. Also let us know if you are
actually following the .htaccess file method outlined or trying to do
it in the main Apache configuration.

Have you yet tried:

  SetHandler mod_python
  PythonHandler mod_python.testhandler

as explained in main mod_python documentation somewhere and made a
request against URL for which that was setup?

Graham

> >>>>> On 12/01/2008, dudley ackerman <rdacker at pacbell.net> wrote:
> >>>>>> text is dumped to web page instead of being interpreted.
> >>>>>>
> >>>>>> using apple python and apache2 on leopard macbook pro:
> >>>>>> mod_python/3.3.1 Python/2.5.1 configured
> >>>>>> i built mod_python with -arch i386 and -arch x86-64 in the
> >>>>>> mod_python
> >>>>>> src/makefile - no problem.
> >>>>>>
> >>>>>> in httpd.conf i have:
> >>>>>> <Directory "/Library/Webserver/Documents">
> >>>>>>   AddHandler mod_python .py
> >>>>>>   PythonHandler mod_python.publisher
> >>>>>>   PythonDebug On
> >>>>>> </Directory>
> >>>>>>
> >>>>>>
> >>>>>> my test script has:
> >>>>>> from mod_python import apache
> >>>>>>
> >>>>>> def hello(req):
> >>>>>> req.content_type = "text/plain"
> >>>>>> req.write("Hollow Earth")
> >>>>>> return
> >>>>>>
> >>>>>> actually, when i try localhost/mptest.py/hello, i get 'file not
> >>>>>> found' -
> >>>>>> going to localhost/mptest.py gives me the text dump of the file.
> >>>>>>
> >>>>>> any suggestions?
> >>>>>> _______________________________________________
> >>>>>> 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