render_templates
渲染模板
* 模板放在 templates 文件夹下
* 从 flask 中导入 render_templates 函数
* 在视图函数中,使用render_templates,只需要写模板 名称.html ,不需要写路径
除非是在templates下在创建子目录就需要把路径补充,以templates为根目录
@app.route(‘/‘) def hello_world(): return render_template(‘index.html‘)
原文:https://www.cnblogs.com/chen-jun552/p/15027968.html