Pylons:Webhelpers:缺少secure_form模块

2 投票
4 回答
1326 浏览
提问于 2025-04-15 19:00

我使用go-pylons.py脚本安装了Pylons 0.9.7。
我有一行Python代码:

from webhelpers.html.secure_form import secure_form

当我尝试运行我的应用程序时,出现了一个错误:没有secure_form这个模块。

我试着写了import webhelpers.html.tags和webhelpers里的其他模块,它们都能正常工作。我在想,为什么我没有secure_form这个模块,怎样才能手动获取这个模块呢?我试着重新运行go-pylons.py,但没有帮助。

有什么想法吗?

4 个回答

1

唉,不知道为什么我安装了1.0b4版本的webhelpers,而且secure_form的路径变了...(http://groups.google.com/group/pylons-discuss/msg/695d73b831a4aee3)我现在的问题是:我该怎么安装webhelpers的旧版本呢?我有easy_install这个工具。

2

我也遇到这个问题了。

如果其他帖子里的内容不太好理解,想要获取旧版本的webhelpers,你可以运行以下命令:

easy_install webhelpers==0.6.4
7

如果你的 webhelpers 版本是 1.0b4 或更高版本,那么 secure_form 就在 webhelpers.pylonslib 这个地方,也就是说。

from webhelpers.pylonslib import secure_form

撰写回答