+ 1
python
I want to find out if the email address "nike@yahoo.com" is in the model with field "email" , if not, return to app users , method new if User.objects.filter("email", "nike@yahoo.com") != None: return redirect("users:new")
1 Odpowiedź
+ 1
I guess your question is related to Django.
You can use Django built in method to validate email address
from django.core.validators import validate_email
try:
validate_email(username)
valid_email = True
except validate_email.ValidationError:
valid_email = False