gpt4 book ai didi

html - 是否可以使用 flask 执行包含?

转载 作者:技术小花猫 更新时间:2023-10-29 11:41:35 26 4
gpt4 key购买 nike

假设我在 template.html 中保存了一个模板布局。此模板包括横幅、侧面导航、内容容器和页脚。我可以使用 flask 以这样的方式分解这些页面元素,以便我可以拥有 banner.html、sidenavigation.html 等文件,并在 template.html 中呈现这些不同的文件吗?

最佳答案

发件人:http://jinja.pocoo.org/docs/templates/#include

模板.html

{% include 'banner.html' %}
{% include 'sidenavigation.html' %}
{% include 'content.html' %}
{% include 'footer.html' %}

关于html - 是否可以使用 flask 执行包含?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9679038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com