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
| Attribute | Type | Description |
|---|---|---|
| widget | [Widget](../widgets/widget.md?sid=django_forms_widgets_widget) = EmailInput | The form widget class used to render the email input field in HTML. |
| default_validators | list = [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
| Name | Type | Description |
|---|---|---|
| **kwargs | dict | Arbitrary keyword arguments passed to the parent CharField constructor. |
Signature
def EmailField(
**kwargs: dict
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| **kwargs | dict | Arbitrary keyword arguments passed to the parent CharField constructor, such as 'required', 'label', or 'initial'. |