Open
Description
This is a tracking issue for changes that will be needed for Django 5.0, based on in-development release notes.
EDIT: Please see #1493 (comment) for an up to date progress list.
(Collapsed original list that is now outdated)
- warnings in
django.utils.deprecation
- admin facets -
ModelAdmin.show_facets
,django.contrib.admin.ShowFacets
enum - form field groups -
BoundField.as_field_group()
,django.forms.Field.template_name
,django.forms.renderers.BaseRenderer.field_template_name
- Database-computed default values -
db_default
arg and attr on modelField
-
django.contrib.admin.AdminSite.get_log_entries
-
django.http.HttpRequest.auser
fromAuthenticationMiddleware
-
django.contrib.gis.db.models.functions.ClosestPoint
-
django.contrib.postgres.constraints.ExclusionConstraint.violation_error_code
-
choices
args to formChoiceField
and modelField
supportChoices
classes directly. -
django.forms.URLField
newassume_scheme
arg -
QuerySet.update_or_create
andaupdate_or_create
newcreate_defaults
arg - new
violation_error_code
arg forBaseConstraint
,CheckConstraint
, andUniqueConstraint
- new arg
error_messages
fordjango.core.paginator.Paginator.error_messages
- new
Signal.asend()
andSignal.asend_robust()
methods - The
instance
argument of the undocumentedBaseModelFormSet.save_existing()
method is renamed toobj
. - The undocumented
django.contrib.admin.helpers.checkbox
is removed. - The undocumented
Query.annotation_select_mask
attribute is changed from a set of strings to an ordered list of strings. - Passing positional arguments name and violation_error_message to
BaseConstraint
is deprecated in favor of keyword-only arguments. (Let's make them keyword-only in the stubs in 5.0.) -
request
is added to the signature ofModelAdmin.lookup_allowed()
. Support for ModelAdmin subclasses that do not accept this argument is deprecated. - The
get_joining_columns()
method ofForeignObject
andForeignObjectRel
is deprecated. Starting with Django 6.0,django.db.models.sql.datastructures.Join
will no longer fallback toget_joining_columns()
. Subclasses should implementget_joining_fields()
instead. - The undocumented
django.utils.baseconv
module is removed. - The undocumented
django.utils.datetime_safe
module is removed. - The
extra_tests
argument forDiscoverRunner.build_suite()
andDiscoverRunner.run_tests()
is removed. - The
USE_L10N
setting is removed. - Support for
pytz
timezones is removed. - The
is_dst
argument is removed from:QuerySet.datetimes()
django.utils.timezone.make_aware()
django.db.models.functions.Trunc()
django.db.models.functions.TruncSecond()
django.db.models.functions.TruncMinute()
django.db.models.functions.TruncHour()
django.db.models.functions.TruncDay()
django.db.models.functions.TruncWeek()
django.db.models.functions.TruncMonth()
django.db.models.functions.TruncQuarter()
django.db.models.functions.TruncYear()
- The
django.contrib.gis.admin.GeoModelAdmin
andOSMGeoAdmin
classes are removed. - [ ]The undocumented
BaseForm._html_output()
method is removed. - The ability to return a
str
, rather than aSafeString
, when rendering anErrorDict
andErrorList
is removed. - The
SitemapIndexItem.__str__()
method is removed. - The
name
argument ofdjango.utils.functional.cached_property()
is removed. - The
opclasses
argument ofdjango.contrib.postgres.constraints.ExclusionConstraint
is removed. - The undocumented ability to pass
errors=None
toSimpleTestCase.assertFormError()
andassertFormsetError()
is removed. -
django.contrib.sessions.serializers.PickleSerializer
is removed. -
created=True
is required in the signature ofRemoteUserBackend.configure_user()
subclasses. - Support for logging out via GET requests in the
django.contrib.auth.views.LogoutView
anddjango.contrib.auth.views.logout_then_login()
is removed. - The
django.utils.timezone.utc
alias todatetime.timezone.utc
is removed. - Passing a response object and a form/formset name to
SimpleTestCase.assertFormError()
andassertFormSetError()
is no longer allowed. - The
django.contrib.gis.admin.OpenLayersWidget
is removed. - The
django.contrib.auth.hashers.CryptPasswordHasher
is removed. - Passing
nulls_first=False
ornulls_last=False
toExpression.asc()
andExpression.desc()
methods, and theOrderBy
expression is no longer allowed.