我在烧瓶中创建了一个简单的表单,我正在尝试将表单数据放入我的app.py
中,但是我目前不确定自己做错了什么,因为我什么时候都没有收到任何信息点击搜索按钮。
这是我的代码;
@app.route('/', methods=['POST', 'GET'])
def main():
if request.method == 'POST':
print("post working")
_radius = request.form['radius']
_postcode = request.form['postcode']
print(_radius, _postcode) # This does not print so the POST method is not working
return render_template("Tails.html", LocationData = _searchfunctionality(_radius, _postcode))
else:
print("default working")
return render_template('Tails.html', LocationData = _longitudelatitude())
HTML;
<form action="/" method="POST">
<input type="text" name = "radius" placeholder="Radius">
<input type="text" name = "postcode" placeholder="Postcode">
<button type="button">Search stores</button>
</form>
任何对此的帮助/建议,将不胜感激。