[mod_python] .htaccess and httpd.conf

Steven D. Arnold stevena at permanent.cc
Sun May 21 17:56:24 EST 2000

At 02:38 PM 5/21/2000 -0700, Wayne Izatt wrote:
>Hi all. I've built and installed a mod_python enabled apache. However,
>I'm not sure what, if any, directives I need to add to httpd.conf to get
>it to pass .py files to the python handler. When I point my browser at
>the test script, all that I get is the script in the browser window.
>Perhaps someone has a sample httpd.conf (just the handler stuff will do)
>or a vanilla .htaccess (if that's where the directives should go).
>(Yes, I've followed the installation instructions, but something simple
>is still eluding me).

I'm having the same experience.

I tried the following directives:

Alias /python /usr/local/apache/htdocs/python

<Location /python/>
     AllowOverride All
     AddHandler python-program .py
     PythonHandler test

When I try loading the page, I get this error:

\nERROR mod_python: "PythonHandler test"

Traceback (innermost last):

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

File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 
70, in resolve_object raise "ResolveError", "Couldn't resolve object '%s' 
in module '%s'." % \

ResolveError: Couldn't resolve object 'handler' in module 'test'.

NOTE: More output from other handlers, if any, may follow. This will NOT 
happen, and request processing will STOP at this point when you remove 
PythonDebug directive.

I'm not quite sure what I'm doing wrong.  Any ideas?


Steven D. Arnold          Que quiero sera           stevena at permanent.cc
"We choose to go to the moon in this decade and do the other things, not
because they are easy, but because they are hard."    -- John F. Kennedy

More information about the Mod_python mailing list