html extends and include

base.html content

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
{% include'include.html'%} Include.html template for adjustment
-----------------Name-------------------<br>
<p>{% block name %}
    block block named name
{% endblock %}</p>
</body>
</html>

extends page content:

{% extends 'base.html' %}
{% block name %}
    Tang someone (replace the content under the block block of base.html)
{% endblock %}

include page content:

< b > This is what is called by include, not by extends.html, but by the initial page, eg base.html </ b >

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325908517&siteId=291194637