[mod_python] test doesn't work

Miguel Marques miguel at yorku.ca
Wed Jun 21 12:10:31 EST 2000


On Tue, 20 Jun 2000 22:00:16 -0400 (EDT), Gregory Trubetskoy <grisha at modpython.org> wrote:
> 
> On Tue, 20 Jun 2000, Gregory Trubetskoy wrote:
> 
> > I am almost certain that this is caused by
> > 
> > 1. a syntax error in test.py
> > 2. a permissions problem
> 
> OR
> 
> 3. If the PythonHandler directive is in httpd.conf outside any <Directory>
> tags, or if PythonHandler is inside a <Directory> different from that in
> which test.py is, then /usr/local/lib/python1.5/test/ gets imported
> instead, which, of course, doesn't have a function called "handler".
> 
> HTH
> 
> Grisha
> 
Well, I have the same problem.  I've tried everything I can think of.
This also happened with mod_python/2.2.
My setup is 
SunOS 5.7 Apache/1.3.12 (Unix) ApacheJServ/1.1 mod_perl/1.24 mod_python/2.4 Python/1.5.2

1. I can run test.py with python as apache (my server run under username apache)
2. I think 1. rules it out and I've checked the permissions of the all
   the python files.
3. my directive is 

<Directory "/usr/local/apache/htdocs/test">
    AddHandler python-program .py
    PythonHandler test
    PythonDebug on
</Directory>
and test.py is in /usr/local/apache/htdocs/test

I always get:

ERROR mod_python: "PythonHandler test"

Traceback (innermost last):

  File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 96, in Dispatch
    object = self.resolve_object(module, object_str)

  File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 42, in resolve_object
    obj = getattr(obj, obj_str)

AttributeError: handler

being somewhat new to python I'm unsure on how to proceed to figure
this out.
Any suggestions?
TIA...

							Miguel

C. Miguel Marques, York University, Computing & Communications Services
e-mail: miguel at yorku.ca, voice: (416)736-2100x22684, fax: (416)736-5830



More information about the Mod_python mailing list