 <p>You can use WTForms. See example below, pulled from <a href="http://flask.pocoo.org/docs/0.10/patterns/wtforms/" rel="nofollow">Flask's documentation</a>:</p> <pre><code>from wtforms import Form, BooleanField, TextField, PasswordField, validators class RegistrationForm(Form): username = TextField('Username', [validators.Length(min=4, max=25)]) email = TextField('Email Address', [validators.Length(min=6, max=35)]) password = PasswordField('New Password', [ validators.Required(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password') accept_tos = BooleanField('I accept the TOS', [validators.Required()]) </code></pre> <p>See the link for the other snippets (view, template, etc).</p>