开发者

Getting contents of Tornado's xsrf_form_html() function outside of a template

开发者 https://www.devze.com 2023-03-04 19:39 出处:网络
I\'m using Tornado for a python application, I want to put the value of xsrf_开发者_StackOverflow社区form_html() in my forms but I\'m using Mustache to render templates instead of the standard Tornado

I'm using Tornado for a python application, I want to put the value of xsrf_开发者_StackOverflow社区form_html() in my forms but I'm using Mustache to render templates instead of the standard Tornado template system. Is there any way to get that value to a variable? I did try

xsrfform = xsrf_form_html()

but that didn't work. Is it under some special class name?

-Sam


I don't know how mustache works, but every RequestHandler has that method, so you must pass it to the template like any other value.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号