我尝试使用flask从html表单获取数据。表单显示在网站上没问题,但当我提交时python没有收到它。在
Html代码:
<form action="/signup" method="post">
<input type="text" name="email"></input>
<input type="submit" value="signup"></input>
</form>
Python代码:
^{pr2}$应用程序
--静态
在----主.css在
--模板
----html代码(主页.html)在
python代码(你好.py)在
代码对我来说很好。 我唯一要改变的是使用
url_for()
构造,而不是直接指定端点。 一、 E.:使用return redirect(url_for('home'))
或者,尝试为您的“注册”端点提供GET请求。在
if
语句下(if request.method == "POST"
)return
。(return redirect(url_for('home'))
,return render_template('xyz.html')
等)相关问题 更多 >
编程相关推荐