2š
I would suggest you subclass EmailField
and substitute its set of default_validators
with a custom validator that also supports the new top-level TLDs.
The default validator is django.core.validators.validate_email
which in turn points to an instance of EmailValidator
, which obviously you will have to subclass as well, and supply an instance of this subclass as the only item in default_validators
attribute of your EmailField
subclass.
You may want to have a look at the newer implementations of EmailValidator
which not only supports TLDs ranging form 2 to 63 characters in length, but also a whitelist
parameter that allows you to inject at custom list of valid domains.
Or, off course, if you prefer just upgrade to a newer Django version. Iām not sure exactly when the support for longer TLDs was added, but Iām sure you could figure that out by looking at the release logs or browsing the source.