Python 3.x 如何将按钮重定向到flask中的根url?
在我的flaskPage.py文件中有上述函数,我想创建一个从下面显示的返回主页按钮到上述根url的链接。但是,的url_不接受空字符串作为参数,并抛出如下错误Python 3.x 如何将按钮重定向到flask中的根url?,python-3.x,web,flask,Python 3.x,Web,Flask,在我的flaskPage.py文件中有上述函数,我想创建一个从下面显示的返回主页按钮到上述根url的链接。但是,的url_不接受空字符串作为参数,并抛出如下错误 @app.route("/") def index(): return render_template("webpage.html") 提前感谢。 Could not build url for endpoint '' 回家 这就解决了问题 Could not build url for endpoint '' <
@app.route("/")
def index():
return render_template("webpage.html")
提前感谢。
Could not build url for endpoint ''
回家
这就解决了问题
Could not build url for endpoint ''
<form method="get" action="{{url_for('index')}}">
<button> Back to Home </button>
</form>