[英]How to get the data in flask from the HTML input with changing the url of website
[英]How To Get image <input> from HTML in flask
快速提問,因為我在其他任何地方都找不到。
如果我有一個像這樣形成的輸入:
<input type="image" name="Text" value="text" src="{{ url_for('static', filename='images/icons/General/Post.svg') }}" />
我如何檢索這個被request.form[]
按下的?
我收到一個 KeyError ,如下所示:
if request.method == "POST":
if request.form["Text"] == "text":
return render_template("PostText.html")
我知道有一種使用<input type="submit" value="text">
檢索數據的類似方法,但它不適用於前者。
謝謝!
編輯:固定格式和語法。
TLDR:我無法在 python 中檢測到來自flask 的image
類型的輸入。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.