为什么web.py模板无法显示?

时间:2014-02-17 08:09:49

标签: python html web.py

我从服务器api获取了json数据并显示在网页上。虽然它总是显示如下: enter image description here

读取数据源数据如下: enter image description here

如何使用“hello world”的新行显示它?

1 个答案:

答案 0 :(得分:1)

根据Templetor - The web.py templating system (web.py)

  

过滤

     

默认情况下,Templetor使用web.websafe过滤器进行HTML编码。

>>> render.hello("1 < 2")
"Hello 1 &lt; 2"
     

关闭过滤器使用:$ 之后。例如:

The following will not be html escaped.
$:form.render()

所以,将$item ...替换为$:item ....