If I try to access a simple python script (test.py) which simply holds a print <some html> statement my browser comes up with
<snip>
Mod_python error: “PythonHandler mod_python.publisher”
Traceback (most recent call last):
File “/usr/lib/python2.5/site-packages/mod_python/apache.py”, line 287, in HandlerDispatch
log=debug)
File “/usr/lib/python2.5/site-packages/mod_python/apache.py”, line 461, in import_module
f, p, d = imp.find_module(parts*, path)
ImportError: No module named mod_python
</snip>
>
> Hmm, maybe this link might help:
>
> ‘ModPython/Articles/GettingModPythonWorking - Graham’s Project Wiki’
> (http://tinyurl.com/2pwc5e)
>
> especially the bits about testing with the CLI python first.
>
>
I get as far as the bit that displays “mptest.py” on the browser but I can’t
get any further.
Presumably this means that mod_python is there and running is just some
configuration in httpd.conf that needs setting - I’ll keep digging but the
apache configuration is a confusing minefield.
> ken yap wrote:
>
>>
>> Hmm, maybe this link might help:
>>
>> ‘ModPython/Articles/GettingModPythonWorking - Graham’s Project Wiki’
>> (http://tinyurl.com/2pwc5e)
>>
>> especially the bits about testing with the CLI python first.
>>
>>
>
> I get as far as the bit that displays “mptest.py” on the browser but I
> can’t get any further.
>
> Presumably this means that mod_python is there and running is just some
> configuration in httpd.conf that needs setting - I’ll keep digging but the
> apache configuration is a confusing minefield.
>
> Alan
>
Ok - I’ve got it working as I wanted - running .py as CGI so that it matches
how things work on my hosted site. Now I can test things locally before
uploading to the live site.
FYI - the apache config ended up as
<snip>
AddHandler mod_python .py
PythonHandler mod_python.cgihandler
PythonDebug On
</snip>
I realise that publisher is the recommended, thread-safe option but I needed
to match the setup at my hosting company.