Last active
January 8, 2019 11:08
-
-
Save pareksha/7479852a5a71a1e5a0f05e9504306354 to your computer and use it in GitHub Desktop.
Easy email validation in django.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.validators import ValidationError | |
try: | |
validate_email(email) | |
except ValidationError: | |
return Response({"status": "error", "message": "Provided email id is invalid."}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment