-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
24 lines (20 loc) · 1.02 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, IntegerField
from wtforms.validators import DataRequired, Email, EqualTo, Length, Optional
class LoginForm(FlaskForm):
username = StringField('Username',
validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
submit = SubmitField('Log In')
class SignupForm(FlaskForm):
username = StringField('Name', validators=[DataRequired()])
password = PasswordField('Password',
validators=
[DataRequired(),
Length(min=6,
message='Please select a stronger password.')])
confirm = PasswordField('Confirm your Password',
validators=[DataRequired(),
EqualTo('password',
message='Passwords must match.')])
submit = SubmitField('Register')