控制代码块的基本使用
image.png
#使用 render_template()方法可以渲染模板,你只要提供模板名称和需要 作为参数传递给模板的变量就行了。
from flask import render_template
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)
#给模板传消息用flash