Hey all.
I am playing with mod_python.
i have made a hello world program
Code:
<html>
<head>
<title>mod_python test</title>
</head>
<body>
<%=print"hello world"%>
</body>
</html>
And i have added this to my httpd.conf file
Code:
<Directory /absolute/path/to/psp/enabled/dir>
AddHandler mod_python .psp .psp_
PythonHandler mod_python.psp
PythonDebug On
</Directory>
I am getting this error
Code:
MOD_PYTHON ERROR
ProcessId: 21020
Interpreter: 'localhost.localdomain'
ServerName: 'localhost.localdomain'
DocumentRoot: '/var/www/projects'
URI: '/test.psp'
Location: None
Directory: '/var/www/projects/'
Filename: '/var/www/projects/test.psp'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'mod_python.psp'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib/python2.6/site-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib/python2.6/site-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)
File "/usr/lib/python2.6/site-packages/mod_python/psp.py", line 336, in handler
p = PSP(req)
File "/usr/lib/python2.6/site-packages/mod_python/psp.py", line 119, in __init__
self.load_from_file()
File "/usr/lib/python2.6/site-packages/mod_python/psp.py", line 191, in load_from_file
code = compile(source, filename, "exec")
File "/var/www/projects/test.psp", line 6
req.write("""<html>
<head>
<title></title>
</head>
<body>
""",0); req.write(str(print"hello world"),0); req.write("""
^
SyntaxError: invalid syntax
Any help is greatly appriciated
/mads