Django,後端傳的html代碼在前端展現

前端使用富文本編輯器 ckeditor 生成的代碼存儲在數據庫中,當從後臺取出要展現到前端時,須要加上 {% autoescape off %} {% endautoescape %} 才能正常顯示
{% autoescape off %}
{{ html_content }}
{% endautoescape %}
或者只是當成通常文本顯示html

相關文章
相關標籤/搜索