I have this html:
<html>
<body>
<form action='super.py'>
<input type=text name=person value="New User" size = 15>
<input type=submit></form>
</body>
</html>
& this python script:
<html>
<body>
<form action='super.py'>
<input type=text name=person value="New User" size = 15>
<input type=submit></form>
</body>
</html>
matio@matio-desktop:~$ cat /var/www/py/super.py
#!/usr/bin/env python
import cgi
rehtml = '''Content-Type: text/html\n
<html><body>
Your name is %s
</body>
</html>
'''
form = cgi.FieldStorage()
who = form['person'].value
print reshtml % (who)
when i click submit:
MOD_PYTHON ERROR
ProcessId: 14109
Interpreter: '127.0.1.1'
ServerName: '127.0.1.1'
DocumentRoot: '/var/www'
URI: '/py/super.py'
Location: None
Directory: '/var/www/py/'
Filename: '/var/www/py/super.py'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'hello'
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1202, in _process_target
module = import_module(module_name, path=path)
File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 304, in import_module
return __import__(module_name, {}, {}, ['*'])
ImportError: No module named hello
whats wrong?