For URL files
URL (r'^tp1/', VIEWS.TP1)
For the views file, jump to tp1.html while uploading the list to the front
def TP1 (Request): = [1, 2, 3, 4, 5, 6] return'tp1.html', {'list< /c14>': List})
For the inherited file master, the content will be replaced by writing {%block tag%}{%endblock%}
<! DOCTYPE html>"en">"UTF-8"> <title>{% block title%}{% endblock%}</title> <link rel="stylesheet"href="/static/commons.css"><style>. PG-content{height:48px; Line-height:48px; Text-Align:center; color:red; Background-Color:white; }</style>class="pg-content"> Little Boy Management </div> {% block content%}{% Endblock%}<script src="/static/jquery-3.3.1.js"></script></body>Inheritors TP1 First imports through {% extends ' master.html '%} master.html
Then fill in the value in {%block tag%}{%endblock%}, and the content that needs to be substituted in master
Tag requires one by one correspondence
' master.html ' %} {% block title%} old boy management {% Endblock%} {% block content%} <ul> { for in list%} <li>{{i}}</li> {% endfor% } </ul>{% endblock%}
Django HTML template inheritance