我有几个要用于我的烧瓶应用程序的模板。
我尝试了以下内容,但它似乎仅直接在/ templates内部查看,而不是/ templates / folder1,templates / folder2等。
return render_template('index.html', template_folder='folder1')
return render_template('folder1/index.html')
两者均无法正常工作,如何指定不同模板的子文件夹。
我认为肖恩是正确的,而且:您是否尝试过使用双引号?我使用的是蓝图,因此可能有所不同,但这就是我的样子:
return render_template("users/register.html")
所以你可能是:
return render_template("folder1/index.html")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句