【发布时间】:2020-04-15 07:08:04
【问题描述】:
我一直在尝试调试这个问题,并且我看到一些类似的线程具有相同的问题,但是即使在交叉检查所有选项之后,我似乎仍然有问题。
我正在使用以下内容:
application.py
@app.route("/Booksearch/<int:book_id>", methods=["GET", "POST"])
def Bookdetails(book_id):
if request.method == "GET":
if session["Username"] is None:
return render_template("error.html", message="Some error message.")
else:
return render_template("some.html")
在我的 HTML 中
<a href="{{ url_for('Bookdetails', books_id=result.id) }}">
当我点击链接时,我可以在浏览器上看到正确的book_id (/Booksearch/123 where book_id=123)。我不确定我做错了什么仍然会出现以下错误。
【问题讨论】:
标签: python html forms flask python-requests