rleon's recent timeline updates
rleon

rleon

V2EX member #8725, joined on 2011-05-15 07:03:55 +08:00
rleon's recent replies
Aug 31, 2018
Replied to a topic by 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 类似的结构下
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2572 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 06:10 · PVG 14:10 · LAX 23:10 · JFK 02:10
♥ Do have faith in what you're doing.