Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将表单提交到当前的 URI,如下所示:
<form action="${CURRENT_URI}" method="post"> <input type="text" name="email" /> </form>
从 mako 模板中。但我不确定哪个变量保存了当前的 uri 信息。
谢谢。
实际上,你不需要它。
<form action="" method="post"> <input type="text" name="email" /> </form>
如果您将操作留空,它将发布到当前 url。
但是,如果您出于其他原因需要当前 url,可以通过调用来检索它pylons.url.current()
pylons.url.current()