Internals
Django Deprecation Timeline
ALLOWED_INCLUDE_ROOTS TEMPLATE_CONTEXT_PROCESSORS TEMPLATE_DEBUG TEMPLATE_DIRS TEMPLATE_LOADERS TEMPLATE_STRING_IF_INVALID The backwards compatibility alias django.template.loader.BaseLoader will be removed. Django template objects returned by get_template() and select_template() won’t accept a Context in their render() method anymore.
Topic guide
Making queries
Retrieving objectsLookups that span relationships
When spanning a ManyToManyField or a reverse ForeignKey (such as from Blog to Entry), filtering on multiple attributes raises the question of whether to require each attribute to coincide in the same related object.
Topic guide
Search
Use CasesDocument-based search
PostgreSQL has its own full text search implementation built-in. While not as powerful as some other search engines, it has the advantage of being inside your database and so can easily be combined with other relational queries such as categorization.
Reference
QuerySet API reference
QuerySet APIMethods that return new QuerySets
values(*fields,**expressions) Returns a QuerySet that returns dictionaries, rather than model instances, when used as an iterable. Each of those dictionaries represents an object, with the keys corresponding to the attribute names of model objects.
Reference
QuerySet API reference
QuerySet APIMethods that return new QuerySets
For example: When using values() together with distinct(), be aware that ordering can affect the results. See the note in distinct() for details.
Topic guide
Models
Fields
Each field takes a certain set of field-specific arguments (documented in the model field reference). For example, CharField (and its subclasses) require a max_length argument which specifies the size of the VARCHAR database field used to store the data.
Topic guide
Models
FieldsRelationships
To define a many-to-many relationship, use ManyToManyField. You use it just like any other Field type: by including it as a class attribute of your model. ManyToManyField requires a positional argument: the class to which the model is related.
Internals
Django Deprecation Timeline
See the Django 1.8 release notes for more details on these changes. Support for calling a SQLCompiler directly as an alias for calling its quote_name_unless_alias method will be removed.
Reference
The Django admin site
ModelAdmin objects
ModelAdmin.preserve_filters : By default, applied filters are preserved on the list view after creating, editing, or deleting an object. You can have filters cleared by setting this attribute to False. ModelAdmin.show_facets : > New in Django 5.0.
Index
| | | | --- | --- | | - cache - template tag - cache_control() (in module django.views.decorators.cache) - cache_key_prefix (backends.cached_db.SessionStore attribute) - CACHE_MIDDLEWARE_ALIAS - setting - CACHE_MIDDLEWARE_KEY_PREFIX - setting - CACHE_MIDDLEWARE_SECONDS - setting - cached.Loader (class in django.template.loaders) …
Release notes
Django 2.2.11 release notes
Fixed a data loss possibility in the select_for_update(). When using related fields or parent link fields with Multi-table inheritance in the of argument, the corresponding models were not locked (#31246).
Release notes
Django 2.2.16 release notes
Fixed a data loss possibility in the select_for_update(). When using related fields pointing to a proxy model in the of argument, the corresponding model was not locked (#31866).
Release notes
Django 3.0.10 release notes
Fixed a data loss possibility in the select_for_update(). When using related fields pointing to a proxy model in the of argument, the corresponding model was not locked (#31866).
Release notes
Django 1.9 release notes
Backwards incompatible changes in 1.9
In earlier versions, queries such as: would implicitly convert to: resulting in SQL like "related_id IN (SELECT id FROM ...)".
Release notes
Django 1.10 release notes
django.shortcuts.render() django.template.Context() django.template.RequestContext() django.template.response.TemplateResponse() The dictionary and context_instance parameters for the following functions are removed: django.shortcuts.render() django.shortcuts.render_to_response() django.template.loader.render_to_string() The dirs parameter for the following functions is removed: django.template.loader.get_template() django.template.loader.select_template() django.shortcuts.render() django.shortcuts.render_to_response() Session verification is enabled regardless of whether or not …
Release notes
Django 3.0.4 release notes
Fixed a data loss possibility when using caching from async code (#31253). Fixed a regression in Django 3.0 that caused a file response using a temporary file to be closed incorrectly (#31240). Fixed a data loss possibility in the select_for_update().
Release notes
Django 1.8 release notes
Backwards incompatible changes in 1.8
A new GeoJSON serializer is now available. It is now allowed to include a subquery as a geographic lookup argument, for example City.objects.filter(point__within=Country.objects.filter(continent='Africa').values('mpoly')). The SpatiaLite backend now supports Collect and Extent aggregates when the database version is 3.0 or later.
Release notes
Django 1.9.2 release notes
Fixed a regression in ConditionalGetMiddleware causing If-None-Match checks to always return HTTP 200 (#26024). Fixed a regression that caused the “user-tools” items to display on the admin’s logout page (#26035).
Release notes
Django 3.1.1 release notes
Fixed wrapping of translated action labels in the admin’s navigation sidebar for East Asian languages (#31853). Fixed wrapping of long model names in the admin’s navigation sidebar (#31854).
Release notes
Django 1.10 release notes
These features have reached the end of their deprecation cycle and are removed in Django 1.10. See Features deprecated in 1.8 for details, including how to remove usage of these features.