Django的render_to_response返回的變量轉義問題解決

使用django框架時後臺返回的值中帶有單引號的全局變量{{變量名}}會把其中的單引號轉義爲' html 一、django會在模版上escape字符串。若是想原樣輸出,須要在模板上用safe filter,即{{ 變量名|safe }}django 二、或是在html中使用{% autoescape on %}{% endautoescape %}標籤對包圍帶有單引號的全局變量:框架 {%
相關文章
相關標籤/搜索