【发布时间】:2013-12-13 19:06:23
【问题描述】:
我有标准的 13.10 Ubuntu。运行 Apache 2 和 mod_python。两者都使用 apt-get 安装。我正在尝试将 GET 变量从客户端传递到服务器,执行 python 脚本,然后返回结果。
这是我的 ApacheConfig(下面是默认加代码):
ScriptAlias /tm/ "/home/tm/"
<Directory /home/tm/ >
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
Python 代码:test.py
import csv
def index():
form = cgi.FieldStorage()
return form
我试过http://myWebsite.com/tm/test.py?testVariable=This
返回:FieldStorage(None, None, []) - 表示 GET 变量没有被传递。
【问题讨论】:
-
为什么要使用 mod_python 开发新代码?
-
@伊格纳西奥。抱歉不明白你的意思。
-
mod_python 已经死了 3.5 年。为什么任何人都在编写使用它的代码?
标签: python apache mod-python