Skip to content

Instantly share code, notes, and snippets.

@mickey06
mickey06 / gist:4770903
Created February 12, 2013 16:00
Flask login with wtfoms validation
class LoginForm(flask_wtf.Form):
"""
Validate login from
"""
email_validator = [flask_wtf.Required()]
pwd_validator = [flask_wtf.Required(), flask_wtf.Length(2)]
email = flask_wtf.TextField(u'email', validators=email_validator)
password = flask_wtf.PasswordField(u'password', validators=pwd_validator)
submit = flask_wtf.SubmitField("Login")