List Info

Thread: Testing Mod_python.




Testing Mod_python.
country flaguser name
Canada
2007-08-31 09:33:25
Hi All,

FYI, I also posted this to you the Mod_python mailing list, but I am hoping someone here might have a solution seeing this before as well.


So I got  mod_python installed, with apache on my windows box running WinXP SP2. When I went to test the mod_install following the directions on this site.

http://www.modpython.org/live/current/doc-html/inst-testing.html

I put the directory in this my httpd.conf file, and it looks like this.

<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test">
  Options FollowSymLinks
&nbsp; AllowOverride All
&nbsp; Order deny,allow
  Satisfy all
&nbsp; AddHandler mod_python .py
&nbsp; PythonHandler mptest
  PythonDebug On
</Directory>

I restarted the Apache server no problem.

My python test file looks like.

from mod_python import apache

def handler(req):
 ; &nbsp; req.content_type = 'text/plain'
   ; req.write("Hello World")
  ;  return apache.OK
File name: mptest.py and it's in the appropriate directory and everything.

When I try to point by browser URL at the python file with this.

http://euclid:9000/Test/mptest.py

I get this error message.

MOD_PYTHON ERROR

ProcessId:      1652
Interpreter:    'euclid.PyxisInnovation.local'

ServerName:     'euclid.PyxisInnovation.local'
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:Python25Libsite-packagesmod_pythonimporter.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)


  File "C:Python25Libsite-packagesmod_pythonimporter.py", line 1202, in _process_target
    module = import_module(module_name, path=path)

  File "C:Python25Libsite-packagesmod_pythonimporter.py", line 304, in import_module
    return __import__(module_name, {}, {}, ['*'])

ImportError: No module named mptest

Any help would be great.

Cheers
Chris Howell
Software Engineer
the PYXIS innovation - Common Ground for Digital Earth
Kingston Ontario
w: www.pyxisinnovation.com
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )