1
我移植的傳統項目,Django和遇到了一個奇怪的數據庫狀態,已備案的內容已被HTML轉義:處理HTML轉義內容和編寫它作爲HTML
<p>
<strong>The &lsquo;Unbundling&rsquo; of Research is a secular, not cyclical, trend as it helps asset managers recognize and reward the value of research more independently</strong>. &nbsp;In 2002, then-New York Attorney General Eliot Spitzer accused major investment banks of promoting companies&#39; shares in their
,以至於當我傾倒這出djnago
<p>{{ object.field | safe }}</p>
輸出,然後再次逃脫:
&lt;p&gt;
真正令人沮喪的。我是新來djnago,我不能我轉換轉義內容以流的HTML出去找這種格式:
<p>
感謝
我使用的第一格式{{object.field | unescape}},我得到的消息過濾器未定義...任何想法? – akaphenom
@akaphenom是否已將'{%load ...%}'放到模板的頂部? – alecxe
不,但我現在看到它在djanogo自定義模板標籤教程:https://docs.djangoproject.com/en/dev/howto/custom-template-tags/我應該很快 – akaphenom