djangodocs.org

1305 sections across all versions Narrow to Django 6.0 (current) →

SlugField

Reference Form fields

classSlugField(**kwargs)[source] : - Default widget: TextInput - Empty value: Whatever you’ve given as empty_value. - Normalizes to: A string. - Uses validate_slug or validate_unicode_slug to validate that the given value contains only letters, numbers, underscores, and hyphens.

dev

URLField

Reference Form fields

classURLField(**kwargs)[source] : - Default widget: URLInput - Empty value: Whatever you’ve given as empty_value. - Normalizes to: A string. - Uses URLValidator to validate that the given value is a valid URL. - Error message keys: required, invalid

dev

EmailField

Reference Form fields Built-in Field classes

classEmailField(**kwargs)[source] : - Default widget: EmailInput - Empty value: Whatever you’ve given as empty_value. - Normalizes to: A string. - Uses EmailValidator to validate that the given value is a valid email address, using a moderately complex regular expression.

4.2 5.0 5.1 5.2 6.0

SlugField

Reference Form fields Built-in Field classes

classSlugField(**kwargs)[source] : - Default widget: TextInput - Empty value: Whatever you’ve given as empty_value. - Normalizes to: A string. - Uses validate_slug or validate_unicode_slug to validate that the given value contains only letters, numbers, underscores, and hyphens.

4.2 5.0 5.1 5.2 6.0

URLField

Reference Form fields Built-in Field classes

classURLField(**kwargs)[source] : - Default widget: URLInput - Empty value: Whatever you’ve given as empty_value. - Normalizes to: A string. - Uses URLValidator to validate that the given value is a valid URL. - Error message keys: required, invalid

4.2 5.0 5.1 5.2 6.0

DecimalField

Reference Form fields

classDecimalField(**kwargs)[source] : - Default widget: NumberInput when Field.localize is False, else TextInput. - Empty value: None - Normalizes to: A Python decimal. - Validates that the given value is a decimal.

dev

FloatField

Reference Form fields

classFloatField(**kwargs)[source] : - Default widget: NumberInput when Field.localize is False, else TextInput. - Empty value: None - Normalizes to: A Python float. - Validates that the given value is a float.

dev

DecimalField

Reference Form fields Built-in Field classes

classDecimalField(**kwargs)[source] : - Default widget: NumberInput when Field.localize is False, else TextInput. - Empty value: None - Normalizes to: A Python decimal. - Validates that the given value is a decimal.

4.2 5.0 5.1 5.2 6.0

FloatField

Reference Form fields Built-in Field classes

classFloatField(**kwargs)[source] : - Default widget: NumberInput when Field.localize is False, else TextInput. - Empty value: None - Normalizes to: A Python float. - Validates that the given value is a float.

4.2 5.0 5.1 5.2 6.0

Validators

Release notes Django 2.0 release notes

The new ProhibitNullCharactersValidator disallows the null character in the input of the CharField form field and its subclasses. Null character input was observed from vulnerability scanning tools.

dev

Validators

Release notes Django 4.1 release notes

The new StepValueValidator checks if a value is an integral multiple of a given step size. This new validator is used for the new step_size argument added to form fields representing numeric values.

dev

Validators

Release notes Django 2.0 release notes What’s new in Django 2.0Minor features

The new ProhibitNullCharactersValidator disallows the null character in the input of the CharField form field and its subclasses. Null character input was observed from vulnerability scanning tools.

4.2 5.0 5.1 5.2 6.0

Validators

Release notes Django 4.1 release notes What’s new in Django 4.1Minor features

The new StepValueValidator checks if a value is an integral multiple of a given step size. This new validator is used for the new step_size argument added to form fields representing numeric values.

4.2 5.0 5.1 5.2 6.0