How to keep input after failed form validation in flask
问题 With django I could simply pass the POST data to the form after failed validation and the user would not have to enter everything again: question_form = QuestionForm(request.POST) choice_form_set = ChoiceFormSet(request.POST) How could I implement this on my own in flask? 回答1: It's pretty similarly possible with Flask as well: @app.route('/register', methods=['GET', 'POST']) def register(): form = RegistrationForm(request.form) if request.method == 'POST' and form.validate(): user = User(form