你可以通过 args 属性来访问 URL 中提交的参数 ( ?key=value ):
from flask import render_template
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)
你可以通过 args 属性来访问 URL 中提交的参数 ( ?key=value ):
from flask import render_template
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)