Wednesday, September 26, 2012

I am in trouble

hello every,
       When I configure apache,mod_pyton and mod_pywebsocket on windows7,some errors occurred,this is a part of my httpd.conf,
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
 
test.py is  test file ,but it does not work
 
test.py:
 
"
from mod_python import apache
       def index(reg):
            retutn "test successful!"
"
 
 
And the following is the erors in my browser:
 
<pre>  MOD_PYTHON ERROR    ProcessId:      5012  Interpreter:    'HP-WORK.mshome.net'    ServerName:     'HP-WORK.mshome.net'  DocumentRoot:   'D:/webserver/htdocs'    URI:            '/test.py'  Location:       None  Directory:      'D:/webserver/htdocs/'  Filename:       'D:\\webserver\\htdocs\\test.py'  PathInfo:       ''    Phase:          'PythonHandler'  Handler:        'mod_python.publisher'    Traceback (most recent call last):      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch      default=default_handler, arg=req, silent=hlist.silent)      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 1229, in _process_target      result = _execute_target(config, req, object, arg)      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 1128, in _execute_target      result = object(arg)      File "D:\program files\Python27\lib\site-packages\mod_python\publisher.py", line 204, in handler      module = page_cache[req]      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 1059, in __getitem__      return import_module(req.filename)      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 296, in import_module      log, import_path)      File "D:\program files\Python27\lib\site-packages\mod_python\importer.py", line 680, in import_module      execfile(file, module.__dict__)      File "D:\webserver\htdocs\test.py", line 2        def index(req):       ^    IndentationError: unexpected indent      MODULE CACHE DETAILS    Accessed:       Wed Sep 26 20:15:52 2012  Generation:     0    _mp_625e47495e7a448168bb400d2e5090cc {    FileName:     'D:\\webserver\\htdocs\\test.py'    Instance:     1 [IMPORT]    Generation:   0 [ERROR]    Modified:     Wed Sep 26 20:02:31 2012  }    </pre>  
 
Has any else met this problem?
Please help.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/nCxI7k5t2-IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment