@app.route('/', methods=['GET', 'POST'])
def index():
form = ContactForm()
if form.validate_on_submit():
# ... do whatever you need
form.reset()
# ...
return render_template('index.html', form=form)