WTForms Install email validator for email validation support
PROBLEM
bash-3.2$ export FLASK_APP=flaskblog.py
bash-3.2$ flask runTraceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.9/bin/flask”, line 8, in
sys.exit(main())
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/cli.py”, line 967, in main cli.main(args=sys.argv[1:], prog_name=”python -m flask” if as_module else None)
File “/Users/shiraj/Documents/GitHub/Python/Flask_blog-complete/forms.py”, line 10, in RegistrationForm validators=[DataRequired(), Email()])
File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/wtforms/validators.py”, line 332, in init
raise Exception(“Install ’email_validator’ for email validation support.”)
Exception: Install ’email_validator’ for email validation support.
SOLUTIONS
bash-3.2$ pip install email_validator
Collecting email_validator
Downloading email_validator-1.1.2-py2.py3-none-any.whl (17 kB)
Collecting idna>=2.0.0
Downloading idna-3.1-py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 2.8 MB/s
Requirement already satisfied: dnspython>=1.15.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from email_validator) (2.1.0)
Installing collected packages: idna, email-validator
Successfully installed email-validator-1.1.2 idna-3.1
bash-3.2$ flask run
Categorised as: Coding, Flask, Python
Leave a Reply
You must be logged in to post a comment.