我的烧瓶代码如下:
@app.route("/home")
def home():
query = {"id": 34,"name": "Elisa"}
return render_template("test.html",param=param)
@app.route("/myfunction")
def myfunc(param):
return render_template("testmyfunction.html",param=param)
我收到以下错误:
TypeError:myfunc()缺少1个必需的位置参数:“ param”
在test.html
中,我试图通过以下方式将param
传递给myfunc()
属性:
href="{{ url_for('myfunc',param=param) }}"