I have a survey form. After submitting the form, I'd like to handle saving the data then redirect to a "success" view. I'm using the following code right now, but it just stays on the current url, while I'd like to go to /success. How can I do this?
@app.route('/surveytest', methods=['GET', 'POST']) def surveytest(): if request.method == 'GET': return render_template('test.html', title='Survey Test', year=datetime.now().year, message='This is the survey page.') elif request.method == 'POST': name = request.form['name'] address = request.form['address'] phone = request.form['phone'] email = request.form['email'] company = request.form['company'] return render_template('success.html', name=name, address=address, phone = phone, email = email, company = company)