我正在使用web2py,我想显示从控制器中的python函数返回的html代码。如何使用Web2Py在视图中显示控制器中的html?
我有以下控制器(default.py):
def index():
return {"html_code":"<img src='https://static1.squarespace.com/static/54e8ba93e4b07c3f655b452e/t/56c2a04520c64707756f4267/1493764650017'>"}
这是我的看法(的index.html):
{{=html_code}}
当我访问的网站(http://127.0.0.1:8000/test/default/index),我见以下内容(而不是图片)
<img src='https://static1.squarespace.com/static/54e8ba93e4b07c3f655b452e/t/56c2a04520c64707756f4267/1493764650017'>
如何将HTML_code变量呈现为html代替纯文本?