一般后台编辑后,存入数据库的是带有html标签的,然后在浏览器显示的时候也都是直接带着html标签。
怎么才能显示成html的格式,而不是直接打印html标签?
{% autoescape off %}
{{ data }}
{% endautoescape %}
或
{{ data|safe }}
一般后台编辑后,存入数据库的是带有html标签的,然后在浏览器显示的时候也都是直接带着html标签。
怎么才能显示成html的格式,而不是直接打印html标签?
{% autoescape off %}
{{ data }}
{% endautoescape %}
或
{{ data|safe }}