Reference Settings Sessions
Default: 'default' If you’re using cache-based session storage, this selects the cache to use.
251 sections in Django 6.0 Search all versions →
Reference Settings Sessions
Default: 'default' If you’re using cache-based session storage, this selects the cache to use.
Topic guide Django’s cache framework Setting up the cache
Here’s an example configuration for a redis based backend that selects database 10 (by default Redis ships with 16 logical databases), and sets a custom connection pool class (redis.ConnectionPool is used by default):
Topic guide Making queries Retrieving objectsRetrieving specific objects with filters
Each time you refine a QuerySet, you get a brand-new QuerySet that is in no way bound to the previous QuerySet. Each refinement creates a separate and distinct QuerySet that can be stored, used and reused.
Internals Django’s security policies Reporting security issuesReporting guidelines
Reports based on a failure to sanitize user input are not valid security vulnerabilities. It is the developer’s responsibility to properly handle user input. This principle is explained in our security documentation.
Topic guide Time zones Concepts
The current time zone is the equivalent of the current locale for translations. However, there’s no equivalent of the Accept-Language HTTP header that Django could use to determine the user’s time zone automatically. Instead, Django provides time zone selection functions.
Topic guide Translation Miscellaneous
set_language(request)[source] As a convenience, Django comes with a view, django.views.i18n.set_language(), that sets a user’s language preference and redirects to a given URL or, by default, back to the previous page.
Release notes Django 2.0 release notes What’s new in Django 2.0Minor features
The new ModelAdmin.autocomplete_fields attribute and ModelAdmin.get_autocomplete_fields() method allow using a Select2 search widget for ForeignKey and ManyToManyField.
Release notes Django 2.1.9 release notes
jQuery before 3.4.0, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable __proto__ property, it could extend the native Object.prototype.
Release notes Django 2.2.2 release notes
jQuery before 3.4.0, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable __proto__ property, it could extend the native Object.prototype.
Release notes Django 3.0 release notes Backwards incompatible changes in 3.0
Added support for the admin_order_field attribute on properties in ModelAdmin.list_display. The new ModelAdmin.get_inlines() method allows specifying the inlines based on the request or model instance. Select2 library is upgraded from version 4.0.3 to 4.0.7.
Release notes Django 3.1 release notes What’s new in Django 3.1Minor features
The new django.contrib.admin.EmptyFieldListFilter for ModelAdmin.list_filter allows filtering on empty values (empty strings and nulls) in the admin changelist view. Filters in the right sidebar of the admin changelist view now contain a link to clear all filters.