【Flask模板】include标签

# include标签:
1. 这个标签相当于是直接将指定的模版中的代码复制粘贴到当前位置。
2. `include`标签,如果想要使用父模版中的变量,直接用就可以了,不需要使用`with context`。
3. `include`的路径,也是跟`import`一样,直接从`templates`根目录下去找,不要以相对路径去找。

如下:

1 <body>
2     {% include 'common/header.html' %}
3     <div class="content">中间</div>
4     {% include "common/footer.html" %}
5 </body>
原文地址:https://www.cnblogs.com/chen0427/p/8476446.html