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
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
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
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
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
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
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
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
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
Reference
PostgreSQL specific form fields and widgets
classHStoreField : A field which accepts JSON encoded data for an HStoreField. It casts all values (except nulls) to strings. It is represented by an HTML <textarea>.
dev
Reference
PostgreSQL specific form fields and widgets
Fields
classHStoreField : A field which accepts JSON encoded data for an HStoreField. It casts all values (except nulls) to strings. It is represented by an HTML <textarea>.
4.2
5.0
5.1
5.2
6.0
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
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
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
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
Release notes
Django 1.4.21 release notes
You might also want to validate that any existing data in your application doesn’t contain unexpected newlines. validate_ipv4_address(), validate_slug(), and URLValidator and their usage in the corresponding form fields GenericIPAddresseField, IPAddressField, SlugField, and URLField are also affected.
dev
Release notes
Django 1.7.9 release notes
… unexpected newlines. validate_ipv4_address(), validate_slug(), and URLValidator are also affected, however, as of Django 1.6 the GenericIPAddresseField, IPAddressField, SlugField, and URLField form fields which use these validators all strip the input, so the possibility of newlines entering your data only exists …
dev
Release notes
Django 1.8.3 release notes
… unexpected newlines. validate_ipv4_address(), validate_slug(), and URLValidator are also affected, however, as of Django 1.6 the GenericIPAddresseField, IPAddressField, SlugField, and URLField form fields which use these validators all strip the input, so the possibility of newlines entering your data only exists …
dev
Release notes
Django 1.4.21 release notes
You might also want to validate that any existing data in your application doesn’t contain unexpected newlines. validate_ipv4_address(), validate_slug(), and URLValidator and their usage in the corresponding form fields GenericIPAddresseField, IPAddressField, SlugField, and URLField are also affected.
4.2
5.0
5.1
5.2
6.0
Release notes
Django 1.7.9 release notes
… unexpected newlines. validate_ipv4_address(), validate_slug(), and URLValidator are also affected, however, as of Django 1.6 the GenericIPAddresseField, IPAddressField, SlugField, and URLField form fields which use these validators all strip the input, so the possibility of newlines entering your data only exists …
4.2
5.0
5.1
5.2
6.0