Validate email address in Django
from django.core.validators import email_re
if email_re.match(email_address):
# Email valid!
else:
# Email not valid!
It's used by the EmailField validation, but you can use anywhere.
Written by Leandro Ardissone
Related protips
2 Responses

thats deprecated now. use:
from django.core.validators import validate_email
try:
validate_email(username)
valid_email = True
except validate_email.ValidationError:
valid_email = False
over 1 year ago
·

@radlws Thanks for the update!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#