-1
我试图让瓶转换器和运行如图所示手册中:http://flask.pocoo.org/docs/0.12/api/#url-route-registrationsPython烧瓶:转换器如何工作? (动态路由)
现在,我目前像这样定义的四页:
@app.route('/page1')
def page1():
return render_template("page1.html")
@app.route('/page2')
def page2():
return render_template("page2.html")
@app.route('/page3')
def page3():
return render_template("page3.html")
@app.route('/page4')
def page4():
return render_template("page4.html")
我找不到而是一种自动化这种重复记法的方法,并且会对提示感激不尽。