Painless form validation using view decorators.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Build Status Documentation Status

Painless form validation (WTForms or Flask-WTF) using view decorators.


Using pip:

pip install Flask-Validates


Most interaction with Flask-Validates is through validates for decorating views and current_form for getting a reference to the form bound to the given route. The following example demonstrates a simple use of the validates decorator which validates a form with two fields:

@app.route("/", methods=["GET", "POST"])
    email=StringField(validators=[DataRequired(), Email()]),
def index():
    if request.method == "POST" and current_form.validate():
        flash("Your feedback has been submitted")
        return redirect(url_for("index"))
    return render_template("contact_form.html.j2", form=current_form)

See examples for more comprehensive examples of usage.

Flask-WTF Support

Flask-Validates can be used with Flask-WTF (and should be compatible with any other WTForms based integration) by initializing the Flask-Validates extension with the FlaskForm class:

FlaskValidates(app, FlaskForm)

Running the tests

python test


The Sphinx-compiled documentation is available here:


This project is licensed under the MIT License - see the LICENSE file for details