作者ntumath (math mad)
看板Python
標題[問題] Django 的小問題
時間Tue Jan 23 07:21:38 2018
最近在寫一個網頁,其中有一個功能是希望管理員可以作po文的動作,為了方便我決定用
django提供的admin UI
然後有一個model其中的一個class(TextField),可是django好像是把我輸入進去的作為
一個字串,如果我想要在admin 介面輸入html tag 並實行應該要如何作呢??
我希望盡可能能利用admin UI來實現,如果有其他更好的作法我也願意嘗試看看~~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.252.182
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1516663301.A.237.html
推 redbxh: {{ field | safe }} 01/23 09:33
感謝r大,請問有相關的reference可以參考嗎?
※ 編輯: ntumath (140.112.25.100), 01/23/2018 10:00:07
→ karta0910489: ert-string-to-html-code-in-django-template 01/23 10:14
感謝兩位大大
※ 編輯: ntumath (140.112.25.100), 01/23/2018 11:04:25
→ redbxh: 我po文都po markdown語法 01/23 16:03