1, tags labels
(1) for the label
format: {% for temporary traverse in sequence endfor% {...}%}%
HTML file:
views file:
urls documents:
HTML :( results of which I form some modifications)
to true-the Result:
2, if-elif-else tag
html file:
views file:
urls file:
results map:
3, load and static labels
When we want to use some static resources such as images, js, css on the page. This time we will have to use a static label.
now, we now display pictures on a Web page, the figure has actually shows up!
Of course views files, urls file is very simple, it does not show up in
(1) to create a static folder, and file templates juxtaposed, (static can easily named), then put in a picture;
(2) is arranged in the settings file
Further, one can add,
display (3) further html file
(4) Results FIG.
4, template inheritance
When we visit some websites, you will find some pages section of the website is the same, such as the navigation bar, or at the bottom, this time we can reduce the amount of code by way of inheritance template.
(1) prepared three pages, in which the same part of the contents,
(2) we put these same parts, made a base.html, and add a small interface such that it can use its html expanded
base of small files interface:
(3) we were in three html file, add their different parts,
(4) This made a simple example