Skip to main content

EmailField

This class represents a specialized character field for handling email addresses, ensuring they conform to standard formatting requirements. It automatically applies email validation and defaults to a maximum length of 320 characters as per RFC 3696. The field also utilizes a specific email input widget and ensures that leading or trailing whitespace is stripped from the input.

Attributes

AttributeTypeDescription
widget[Widget](../widgets/widget.md?sid=django_forms_widgets_widget) = EmailInputThe form widget class used to render the email input field in HTML.
default_validatorslist = [validators.validate_email]A list of validation functions applied to the field value, initialized with a validator that ensures the input is a valid email address format.

Constructor

Signature

def EmailField(
**kwargs: dict
) - > null

Parameters

NameTypeDescription
**kwargsdictArbitrary keyword arguments passed to the parent CharField constructor.

Signature

def EmailField(
**kwargs: dict
) - > null

Parameters

NameTypeDescription
**kwargsdictArbitrary keyword arguments passed to the parent CharField constructor, such as 'required', 'label', or 'initial'.