djangodocs.org

663 sections in Django 5.0 Search all versions →

Making requests

Topic guide Testing tools The test client

Serialization is performed with [`DjangoJSONEncoder`](../serialization.md#django.core.serializers.json.DjangoJSONEncoder) by default, and can be overridden by providing a `json_encoder` argument to [`Client`](#django.test.Client). This serialization also happens for [`put()`](#django.test.Client.put), [`patch()`](#django.test.Client.patch), and [`delete()`](#django.test.Client.delete) requests. If you provide any other `content_type` (e.g.

A

Index

… (RelatedManager method) - add_action() (AdminSite method) - add_arguments() (BaseCommand method) - (DiscoverRunner class method) - add_constraint() (BaseDatabaseSchemaEditor method) - add_error() (Form method) - add_field() (BaseDatabaseSchemaEditor method) - add_form_template (ModelAdmin attribute) - add_index() (BaseDatabaseSchemaEditor method) - add_item() (SyndicationFeed method) - add_item_elements() …

E

Index

… - EMAIL_USE_SSL - setting - EMAIL_USE_TLS - setting - email_user() (models.User method) - EmailField (class in django.db.models) - (class in django.forms) - EmailInput (class in django.forms) - EmailMessage (class in django.core.mail) - EmailValidator (class in django.core.validators) - empty (GEOSGeometry attribute) …

R

Index

… | | --- | --- | | - Radians (class in django.db.models.functions) - radio_fields (ModelAdmin attribute) - RadioSelect (class in django.forms) - raise_exception (AccessMixin attribute) - random - template filter - Random (class in django.db.models.functions) - RandomUUID (class in django.contrib.postgres.functions) …

S

Index

… (File method) - (LayerMapping method) - (Model method) - (Storage method) - save_as (ModelAdmin attribute) - save_as_continue (ModelAdmin attribute) - save_formset() (ModelAdmin method) - save_model() (ModelAdmin method) - save_on_top (ModelAdmin attribute) - save_related() (ModelAdmin method) - savepoint() (in module django.db.transaction) …

F

Index

… fid (Feature attribute) - field - (BoundField attribute) - Field (class in django.contrib.gis.gdal) - (class in django.db.models) - (class in django.forms) - field (ModelChoiceIterator attribute) - field lookup type - arrayfield.contained_by - arrayfield.contains - arrayfield.index - arrayfield.len - arrayfield.overlap - …

EmailField

Reference Form fields Built-in Field classes

classEmailField(**kwargs) : - 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.

SlugField

Reference Form fields Built-in Field classes

classSlugField(**kwargs) : - 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.

URLField

Reference Form fields Built-in Field classes

classURLField(**kwargs) : - 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

DecimalField

Reference Form fields Built-in Field classes

classDecimalField(**kwargs) : - 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.

FloatField

Reference Form fields Built-in Field classes

classFloatField(**kwargs) : - 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.

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.

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.

Extended IPv6 support

Release notes Django 1.4 release notes What’s new in Django 1.4

Django 1.4 can now better handle IPv6 addresses with the new GenericIPAddressField model field, GenericIPAddressField form field and the validators validate_ipv46_address and validate_ipv6_address.

Bugfixes

Release notes Django 2.1.4 release notes

Corrected the default password list that CommonPasswordValidator uses by lowercasing all passwords to match the format expected by the validator (#29952).

Models

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

(This validator moved to the form field in Django 1.11.2.) Added support for time truncation to Trunc functions. Added the ExtractWeek function to extract the week from DateField and DateTimeField and exposed it through the week lookup.