Complete the code to import the Flask-WTF form base class.
from flask_wtf import [1]
The correct import for creating forms in Flask-WTF is FlaskForm.
Complete the code to add a required string field named 'username' to the form.
from wtforms import StringField from wtforms.validators import [1] class MyForm(FlaskForm): username = StringField('Username', validators=[[1]()])
DataRequired validator ensures the field is not empty and is the recommended validator for required fields in Flask-WTF.
Fix the error in the code by completing the validator import correctly.
from wtforms.validators import [1] class EmailForm(FlaskForm): email = StringField('Email', validators=[DataRequired(), [1]()])
The correct validator to check email format is Email from wtforms.validators.
Fill both blanks to create a password field with length validation between 6 and 12 characters.
from wtforms import PasswordField from wtforms.validators import DataRequired, [1] class PasswordForm(FlaskForm): password = PasswordField('Password', validators=[DataRequired(), [2](min=6, max=12)])
The Length validator checks the length of input. It is imported and used to enforce min and max length.
Fill all three blanks to create a form with a username field that is required, has a length between 4 and 25, and an email field that is required and validated.
from wtforms import StringField from wtforms.validators import [1], [2], Email class UserForm(FlaskForm): username = StringField('Username', validators=[[1](), [2](min=4, max=25)]) email = StringField('Email', validators=[[1](), Email()])
DataRequired ensures fields are not empty, Length enforces username length, and Email validates email format.