djangodocs.org

246 sections in Django 5.1 Search all versions →

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.

django.contrib.admin

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.

django.contrib.admin

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.

django.contrib.admin

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.