[問題] Django 的小問題

看板Python作者 (math mad)時間7年前 (2018/01/23 07:21), 7年前編輯推噓1(103)
留言4則, 2人參與, 7年前最新討論串1/1
最近在寫一個網頁,其中有一個功能是希望管理員可以作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

01/23 09:33, 7年前 , 1F
{{ field | safe }}
01/23 09:33, 1F
感謝r大,請問有相關的reference可以參考嗎? ※ 編輯: ntumath (140.112.25.100), 01/23/2018 10:00:07

01/23 10:13, 7年前 , 2F

01/23 10:14, 7年前 , 3F
ert-string-to-html-code-in-django-template
01/23 10:14, 3F
感謝兩位大大 ※ 編輯: ntumath (140.112.25.100), 01/23/2018 11:04:25

01/23 16:03, 7年前 , 4F
我po文都po markdown語法
01/23 16:03, 4F
文章代碼(AID): #1QPd858t (Python)
文章代碼(AID): #1QPd858t (Python)