whatever.html
{% extends "base_site.html" %}{% block content %}
<button type="button" onclick="displayData({{strings}})">DisplayData</button>{%endblock%}
whatevery.py
from dajngo.shortcuts import render
def whatever(request):
strings = '<hr><p>我的段落</p>'
return render(request, 'whatever.html', {'strings':strings})
你现在代码不报错?