后端
def make_safe(request):
from django.utils.safestring import mark_safe
temp = "<a href=‘http://www.baidu.com
‘>百度</a>"
newtemp = mark_safe(temp)
return render(request, ‘make_safe.html‘, {‘temp‘: newtemp})
全段
|safe
时间: 2024-11-06 10:02:16