【发布时间】:2011-06-19 17:09:36
【问题描述】:
我正在用 apache 和 mod_python 构建一个 Web 服务器。我已经创建了 index.py,就像我看到其他人所做的那样,但与其他人不同的是,如果不将 .py 添加到 url,我将无法访问网页。
例如,http://127.0.1.1/commentsubmit 产生 404,但 http://127.0.1.1/commentsubmit.py 按预期显示页面。
一切都在我的 index.py 中,http://127.0.1.1/ 可以正常运行,但没有 .py 就没有别的了。我的其他方法如下所示:
def commentsubmit(req):
rest of method
我很确定问题出在 mod_python 上,但我不知道是什么。是否有某种配置设置可以做到这一点? from mod_python import apache 以外的东西我应该导入吗?
【问题讨论】:
标签: python apache url mod-python