一、模板与html关联
def index(request):
return render(request,'booltest/index.html',{})
二、模板文件对应的html文件相关变量写法:
1、变量引用,for循环
<body>
{{ my_dict.title }}<br/>
{{ book.btitle }}<br/>
{% for book in booktag %}
<li>{{ forloop.counter }}--->{{ book.btitle }}</li>
{% endfor %}
</body>