Python论坛  - 讨论区

标题:[python-chinese] 最简单的mod_python处理器出错,why??

2007年03月25日 星期日 21:28

jessinio smith jessinio在gmail.com
星期日 三月 25 21:28:19 HKT 2007


    AddHandler mod_python .py
    PythonHandler test
    PythonPath "sys.path + ['/var/www/mod_python/']"
    PythonDebug On



дһ¸ötest.pyÎļþ£º

from mod_python import apache
def handler(req):
   req.content_type = "text/plain"
   req.write("Hello World!")
   return apache.OK

°ÑËü·ÅÔÚ/var/www/mod_python/ÏÂÀ

ÕâÑù·ÃÎÊ£º
http://localhost/mod_python/test.py

³ö´í£º

Mod_python error: "PythonHandler test"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
291, in HandlerDispatch
    arg=req, silent=hlist.silent)

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
531, in resolve_object
    raise AttributeError, s

AttributeError: module '/usr/lib/python2.4/test/__init__.pyc' contains
no 'handler'

Ôõô»ØÊ£¿£¿


-- 
×¢ÒâÉíÌ壬ÉíÌåÊǸïÃüµÄ±¾Ç®£¡£¡
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070325/6a798411/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年03月26日 星期一 13:23

jessinio smith jessinio在gmail.com
星期一 三月 26 13:23:41 HKT 2007

ÎÊÌâ½â¾ö£¡£¡
pythonûÓÐʹÓÃÎÒµÄtest£¬¶øÊÇʹÓÃ/usr/libÀïµÄtest£¡



On 3/25/07, jessinio smith <jessinio在gmail.com> wrote:
>
> 
>     AddHandler mod_python .py
>     PythonHandler test
>     PythonPath "sys.path + ['/var/www/mod_python/']"
>     PythonDebug On
> 
>
>
> дһ¸ötest.pyÎļþ£º
>
> from mod_python import apache
> def handler(req):
>    req.content_type
>  = "text/plain"
>    req.write("Hello World!")
>    return apache.OK
>
> °ÑËü·ÅÔÚ/var/www/mod_python/ÏÂÀ
>
> ÕâÑù·ÃÎÊ£º
>
> http://localhost/mod_python/test.py
>
> ³ö´í£º
>
> Mod_python error: "PythonHandler test"
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 291, in HandlerDispatch
>
>     arg=req, silent=hlist.silent)
>
>   File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 531, in resolve_object
>     raise AttributeError, s
>
> AttributeError: module '/usr/lib/python2.4/test/__init__.pyc' contains no 'handler'
>
>
> Ôõô»ØÊ£¿£¿
>
>
> --
> ×¢ÒâÉíÌ壬ÉíÌåÊǸïÃüµÄ±¾Ç®£¡£¡




-- 
×¢ÒâÉíÌ壬ÉíÌåÊǸïÃüµÄ±¾Ç®£¡£¡
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070326/4d7c2093/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号