[mod_python] Testing Python Mod

Chris Howell chowell at pyxisinnovation.com
Fri Aug 31 11:42:22 EDT 2007


Hi All,

So in regards to a follow up on my last post. I found this page at.

http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking

Which describes how to get the python mod working for apache and I 
changed it around so that I was no longer trying to access it globally.

My .htaccess file looks like

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

And is found in the same directory as my *.py file.

My httpd.conf file has this entry in it now.

<Directory "C:/Program Files/Apache Software 
Foundation/Apache2.2/htdocs/Test">
AllowOverride FileInfo
</Directory>

When I attempt to access the .py file. I get this message up.

MOD_PYTHON ERROR

ProcessId:      2544
Interpreter:    '192.168.0.42'

ServerName:     '192.168.0.42'
DocumentRoot:   'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs'

URI:            '/Test/mptest.py'
Location:       None
Directory:      'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/'
Filename:       'C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/Test/mptest.py'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'mptest'

Traceback (most recent call last):

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named mptest

So I've tried two approaches and I am stumped on both of them. 
I would sincerely appreciate any help. 

Cheers
Chris Howell 
Software Engineer 
the PYXIS Innovation - /Common Ground for Digital Earth 
Kingston Ontario.
/www.pyxisinnovation.com





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070831/4ec16d60/attachment-0001.html


More information about the Mod_python mailing list