From 9247410b4ba3b1f855567b8d84422d36345c690a Mon Sep 17 00:00:00 2001 From: YashRaj1506 Date: Sun, 4 Jan 2026 16:37:23 +0530 Subject: [PATCH 1/4] Fixed #36815 -- Optimized insertion of db_default fields in bulk_create(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Adam Sołtysik for the implementation idea. --- django/db/models/sql/compiler.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index dd957ec76595..1b1cd91c9a80 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -1819,9 +1819,13 @@ def as_sql(self): for field in list(fields): field_prepare = partial(self.prepare_value, field) field_pre_save = partial(self.pre_save_val, field) - field_values = [ - field_prepare(field_pre_save(obj)) for obj in self.query.objs - ] + + field_values = [] + for obj in self.query.objs: + value = field_pre_save(obj) + if not isinstance(value, DatabaseDefault): + value = field_prepare(value) + field_values.append(value) if not field.has_db_default(): value_cols.append(field_values) From 0a983330cd57dd2bb1dfa91a5a3ed742559eebe6 Mon Sep 17 00:00:00 2001 From: Andrea Zanotto Date: Thu, 8 Jan 2026 10:16:18 +0100 Subject: [PATCH 2/4] Fixed #36853 -- Fixed technical 500 and 404 email CSS support. --- django/views/templates/technical_404.html | 2 +- django/views/templates/technical_500.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/views/templates/technical_404.html b/django/views/templates/technical_404.html index 73abb22af465..f7a60d23fbad 100644 --- a/django/views/templates/technical_404.html +++ b/django/views/templates/technical_404.html @@ -9,7 +9,7 @@ body * { padding:10px 20px; } body * * { padding:0; } body { font-family: sans-serif; background:#eee; color:#000; } - body > :where(header, main, footer) { border-bottom:1px solid #ddd; } + body > header, body > main, body > footer { border-bottom:1px solid #ddd; } h1 { font-weight:normal; margin-bottom:.4em; } h1 small { font-size:60%; color:#666; font-weight:normal; } table { border:none; border-collapse: collapse; width:100%; } diff --git a/django/views/templates/technical_500.html b/django/views/templates/technical_500.html index a2fc8415f56d..a7a55dda434f 100644 --- a/django/views/templates/technical_500.html +++ b/django/views/templates/technical_500.html @@ -10,7 +10,7 @@ body * { padding:10px 20px; } body * * { padding:0; } body { font-family: sans-serif; background-color:#fff; color:#000; } - body > :where(header, main, footer) { border-bottom:1px solid #ddd; } + body > header, body > main, body > footer { border-bottom:1px solid #ddd; } h1 { font-weight:normal; } h2 { margin-bottom:.8em; } h3 { margin:1em 0 .5em 0; } From 1d15c732bb9dde0fca8bd662a475bb51d0ab2756 Mon Sep 17 00:00:00 2001 From: Clifford Gama Date: Fri, 9 Jan 2026 22:19:36 +0200 Subject: [PATCH 3/4] Refs #35381 -- Added missing deprecation note for using None as RHS of JSONExact. --- docs/internals/deprecation.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 2473d2b4f7b8..280187b36872 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -59,6 +59,11 @@ details on these changes. * Calling :meth:`.QuerySet.values_list` with ``flat=True`` and no field name will raise ``TypeError``. +* The use of ``None`` when querying a :class:`~django.db.models.JSONField` + top-level value will compile to SQL ``IS NULL``. Use + :class:`~django.db.models.JSONNull` to query for a JSON ``null`` value + instead. + .. _deprecation-removed-in-6.1: 6.1 From 8a0315fab74d603813b2a64ab98d5a208a2eb6d1 Mon Sep 17 00:00:00 2001 From: mbcodes Date: Tue, 12 Nov 2024 20:17:15 -0800 Subject: [PATCH 4/4] Refs #35875 -- Added dark mode support in additional views. Thanks Thibaud Colas for the review. --- .../contrib/admin/templates/admin/base.html | 1 + django/views/templates/csrf_403.html | 1 + django/views/templates/default_urlconf.html | 43 ++++++++++--------- django/views/templates/directory_index.html | 1 + django/views/templates/technical_404.html | 1 + django/views/templates/technical_500.html | 1 + tests/middleware/test_csp.py | 2 +- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html index 16c1808a0ca4..73121e511498 100644 --- a/django/contrib/admin/templates/admin/base.html +++ b/django/contrib/admin/templates/admin/base.html @@ -3,6 +3,7 @@ {% block title %}{% endblock %} + {% block dark-mode-vars %} diff --git a/django/views/templates/csrf_403.html b/django/views/templates/csrf_403.html index ee81b04bcc48..6a0daad5eed5 100644 --- a/django/views/templates/csrf_403.html +++ b/django/views/templates/csrf_403.html @@ -2,6 +2,7 @@ + 403 Forbidden