Django EmailField accepts invalid values
I'm currently using the default EmailField attribute on my form. The issue
I'm running into is that the form considers an invalid email such as
name@mail.56 to be valid. Do I need to implement my own validators on this
field to make it work correctly?
I was under the impression that having:
#models.py
email = models.EmailField(max_length=254, blank=False, unique=True,
error_messages={'required': 'Please provide your email address.',
'unique': 'An account with this email exist.'},)
Or having:
#forms.py
email = forms.EmailField()
will take care of this type of validation for me but it doesn't seem so.
No comments:
Post a Comment