Flask重定向路由后,已经重定向并且服务器返回状态码200了,但是页面没有任何变化
@app.route('/index', methods=['POST', 'GET'])
def index(): # put application's code here
print("!111")
return render_template('index.html')
@app.route('/login')
def login():
form = LoginForm()
if request.method == 'POST':
user_name = request.form.get('username')
psw = request.form.get('password')
if form.validate_on_submit():
print(user_name, psw)
return redirect(url_for('index'))
return render_template('login.html', form=form)
相似问题