text: from flask_wtf import FlaskForm
  from wtforms import StringField,PasswordField,BooleanField,SubmitField
  from wtforms.validators import Required,Email,EqualTo
  from ..model import User
  from wtforms import ValidationError
  
  
  class RegistrationForm(FlaskForm):
      email = StringField('Your Email Address',validators=[Required(),Email()])
      username = StringField('Enter your username',validators = [Required()])
      password = PasswordField('Password',validators = [Required(), EqualTo('password_confirm',message = 'Passwords must match')])
      password_confirm = PasswordField('Confirm Passwords',validators = [Required()])
      submit = SubmitField('Sign Up')
  
      # password and email verification
      def validate_email(self,data_field):
          if User.query.filter_by(email = data_field.data).first():
              raise ValidationError("There's an account with that email")
      
      def validate_username(self,data_field):
          if User.query.filter_by(username=data_field.data).first():
              raise ValidationError("That user name is taken")
  
  class LoginForm(FlaskForm):
      email = StringField('Your Email Address',validators=[Required(),Email()])
      password = PasswordField('Password',validators=[Required()])
      remember = BooleanField('remember me')
      submit = SubmitField('Sign In')