rleon 最近的时间轴更新
rleon

rleon

V2EX 第 8725 号会员,加入于 2011-05-15 07:03:55 +08:00
rleon 最近回复了
2018-08-31 15:42:28 +08:00
回复了 cuijiudai 创建的主题 Flask flask Blueprint 的不解!
其实官方文档有说明 http://flask.pocoo.org/docs/1.0/blueprints/

多个 blueprint 的 template_folder 参数,会添加到系统的搜索路径下。这样,后面的 blueprint 路径会在前面。如果,多个 blueprint 都用类似 render_template("pages/index.html") ,则优先使用后面添加的 blueprint 下的 template_folder 路径。

官方建议是,使用用如 render_template("bp1/index.html") ,render_folder("bp2/index.html"),
并且放在路径 bp1/templates/bp1/index.html , bp2/templates/bp2/index.html 类似的结构下
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2759 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 12:43 · PVG 20:43 · LAX 05:43 · JFK 08:43
Developed with CodeLauncher
♥ Do have faith in what you're doing.