I have a profile. After submitting the form, I would like to process the data storage and then redirect to the "sucess" view. I am using the following code right now, but it just stays at the current URL, while I would 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)
tommy source share