0

我是 Python Web 框架的新手,我选择 web.py 作为起点。

我按照 web.py 网站上的教程,发现了 urls、POST 和 GET 的工作原理,但我对如何使用模板和模板引擎感到困惑。

我有一个自定义 html 表单,想在我的应用程序中使用它。我应该使用“模板引擎”还是应该使用 web.py 内置表单库?

谁能给我一个如何将自定义表单值发布到 web.py 应用程序的示例?(使用没有内置库的表单。)

提前致谢。

4

2 回答 2

1

You can use web.py form library to render only parts of the form in your templates, see http://webpy.org/cookbook/form_fields

于 2012-10-04T04:39:28.777 回答
1

Andrey Kuzmin 的回答与“自定义表单”不兼容。他链接的教程是通过 web.py 生成的表单您可以获取自定义表单的表单变量

    def POST(self):
        user_data = web.input()
        return user_data.YOUR_CUSTOM_HTML_FORM_VAR
于 2013-01-29T13:44:10.577 回答