def index(): form = InputForm(request.form) if request.method == 'POST' and form.validate(): for field in form: exec('{} = {}'.format(field.name, field.data)) result = timeline() else: result = None return render_template(template_name + '.html', result=result)