1
0
mirror of https://github.com/django/django.git synced 2025-08-21 17:29:13 +00:00

33681 Commits

Author SHA1 Message Date
Sarah Boyce
6aa05fd232 Triggered window resize to fix layout issues. 2025-07-18 17:29:12 +02:00
nessita
e767bd6838
Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches. 2025-07-18 08:47:44 -03:00
IsJn-227
be8c9b19ba Fixed #36456 -- Improved content type negotiation in technical 500 error response. 2025-07-18 10:18:22 +02:00
Clifford Gama
449b9f9aee Fixed #35728 -- Computed error messages in assertions only on test failures.
Performance regression in 1dae65dc63ae84be5002c37b4ddae0b9220e8808.

Thanks to Adam Johnson for the report.
2025-07-18 10:16:59 +02:00
Clifford Gama
04e813cd17 Refs #4476 -- Added tests for assertRedirects() when following redirect chains.
Thanks Natalia Bidart for the review.
2025-07-17 17:36:02 -03:00
Clifford Gama
024ea0f783 Split monolithic AssertContainsTests.test_contains() into focused tests.
Added a local helper to test assertion messages with and without a given
msg_prefix.
2025-07-17 17:36:02 -03:00
Mike Edmunds
6320915053 Refs #36163 -- Reordered EmailMessage options in docs/topics/email.txt.
Reordered the keyword-only EmailMessage parameters in the documentation
to group similar options together and move rarely used options later.

Used keywords for *all* parameters in EmailMessage examples to improve
clarity.
2025-07-17 14:01:16 -03:00
Mike Edmunds
fc793fc303 Fixed #36163 -- Deprecated most positional arguments in django.core.mail.
In public mail APIs, changed less frequently used parameters from
keyword-or-positional to keyword-only, emitting a warning during the
required deprecation period.
2025-07-17 14:01:16 -03:00
Mike Edmunds
5289ce65b9 Fixed get_connection() signature in docs/topics/email.txt.
django.core.mail.get_connection() has always supported only variable
keyword arguments (never variable positional arguments).
2025-07-17 14:01:16 -03:00
Salvo Polizzi
a5cd84ad20 Fixed #35680 -- Added automatic imports of common utilies to shell management command. 2025-07-17 12:51:43 +02:00
nessita
8499fba0e1
Fixed GitHub Action that checks commit prefixes to fetch PR head correctly. 2025-07-16 15:36:33 -03:00
Mike Edmunds
40d6eb2c01 Refs #35581 -- Added workaround for Python bug in mail tests.
See python/cpython#128110.
2025-07-16 15:33:14 +02:00
Mike Edmunds
5ca470a52e Refs #35581 -- Reduced implementation dependencies in mail tests.
Updated mail tests in preparation for migrating from Python's legacy
to modern email API. The updated tests will pass with either Python API,
and focus on desired outcomes (e.g., that a message with non-ASCII
content parses accurately at the receiving end) rather than specific
implementation details (e.g., where rfc2047 encoded-words are split).

In a few cases that are still implementation dependent, added comments
identifying behavior specific to the legacy email API and expected to
change under the modern one.

Added comments identifying tests that cover internal functions planned
for deprecation, and (where meaningful) added similar tests to verify
the equivalent behavior in non-deprecated features.

Removed obsolete tests left over from Python 2.
2025-07-16 15:33:14 +02:00
Mike Edmunds
f42b89f1bf
Fixed #36477, Refs #36163 -- Added @deprecate_posargs decorator to simplify deprecation of positional arguments.
This helper allows marking positional-or-keyword parameters as keyword-only with a deprecation period, in a consistent and correct manner.
2025-07-16 08:49:03 -03:00
nessita
10386fac00
Added GitHub Action to enforce stable branch commit message prefix. 2025-07-16 08:38:13 -03:00
Clifford Gama
ac2d907f45
Fixed typo in docs/ref/utils.txt. 2025-07-13 19:38:23 +02:00
Jacob Walls
43c68042c9
Skipped test_no_logs_without_debug test when the runner is invoked with --debug-sql. 2025-07-13 18:29:34 +02:00
Tim Schilling
395e498553 Added Django ecosystem page to the documentation. 2025-07-13 14:09:47 +02:00
Simon Charette
0fe218842e
Fixed #36502 -- Restored UNNEST strategy for foreign key bulk inserts on PostgreSQL.
Regression in 764af7a3d6c0b543dcf659a2c327f214da768fe4.
2025-07-10 18:33:00 +02:00
tinmarbusir
994950e886
Fixed typo in ReverseManyToOneDescriptor docstring. 2025-07-09 18:10:04 +02:00
Carlton Gibson
a8912e4383
Updated asgiref dependency. 2025-07-09 18:06:49 +02:00
Mariusz Felisiak
426be74022
Refs #35844, #35945 -- Used asgiref.sync.iscoroutinefunction() instead of deprecated asyncio.iscoroutinefunction().
Follow up to bd3b1dfa2422e02ced3a894adb7544e42540c97d.
Introduced in 2ae3044d9d4dfb8371055513e440e0384f211963.

Fixes DeprecationWarning:

'asyncio.iscoroutinefunction' is deprecated and slated for removal
in Python 3.16; use inspect.iscoroutinefunction() instead.
2025-07-09 18:01:44 +02:00
Clifford Gama
6df19412aa
Refs #27236 -- Removed references to removed index_together migration methods. 2025-07-03 15:23:25 +02:00
Natalia
94ebcf8366 Added release date for 5.2.4. 2025-07-02 15:55:14 -03:00
Natalia
7ab6b863da Added stub release notes for 5.2.5. 2025-07-02 15:51:02 -03:00
Matthew Stell
7feafd79a4 Fixed #35846 -- Ensured consistent path ordering in ManifestStaticFilesStorage manifest files.
This change reuses the existing sorting of `hashed_files` in
`ManifestStaticFilesStorage.save_manifest` to also store a sorted
`paths` mapping in the manifest file. This ensures stable manifest
output that does not change unnecessarily.
2025-07-01 15:24:34 -03:00
Roel Delos Reyes
58fc40427f Fixed #36479 -- Improved how FileNotFoundError is triggered in code formatter tests.
Ensured the test for formatter subprocess FileNotFoundError doesn't rely
on platform-specific behavior, improving reliability on macOS and other
systems by consistently using pathlib to build test paths.
2025-07-01 15:24:07 -03:00
Simon Charette
192bc7a7be Fixed #36464 -- Fixed "__in" tuple lookup on backends lacking native support.
When native support for tuple lookups is missing in a DB backend, it can
be emulated with an EXISTS clause. This is controlled by the backend
feature flag "supports_tuple_lookups".

The mishandling of subquery right-hand side in `TupleIn` (added to
support `CompositePrimaryKey` in Refs #373) was likely missed because
the only core backend we test with the feature flag disabled
(Oracle < 23.4) supports it natively.

Thanks to Nandana Raol for the report, and to Sarah Boyce, Jacob Walls,
and Natalia Bidart for reviews.
2025-06-30 20:15:25 -03:00
Natalia
ff0ff98d42 Refs #15727 -- Updated AdminSeleniumTestCase to use ContentSecurityPolicyMiddleware.
Replaced the custom CSP middleware previously used in the admin's
AdminSeleniumTestCase with the official ContentSecurityPolicyMiddleware.
This change ensures alignment with Django's built-in CSP support.

Also updates the test logic to inspect browser console logs to assert
that no CSP violations are triggered during Selenium admin tests.
2025-06-27 15:57:02 -03:00
Rob Hudson
d63241ebc7 Fixed #15727 -- Added Content Security Policy (CSP) support.
This initial work adds a pair of settings to configure specific CSP
directives for enforcing or reporting policy violations, a new
`django.middleware.csp.ContentSecurityPolicyMiddleware` to apply the
appropriate headers to responses, and a context processor to support CSP
nonces in templates for safely inlining assets.

Relevant documentation has been added for the 6.0 release notes,
security overview, a new how-to page, and a dedicated reference section.

Thanks to the multiple reviewers for their precise and valuable feedback.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-06-27 15:57:02 -03:00
antoliny0919
3f59711581 Fixed #36366 -- Improved accessibility of pagination in the admin. 2025-06-27 18:03:16 +02:00
wookkl
29f5e1e97d Fixed #35595, #35962 -- Removed indexes and constraints before fields in migrations. 2025-06-27 17:17:45 +02:00
Sarah Boyce
a388287692 Fixed indentation in docs/internals/howto-release-django.txt. 2025-06-27 09:46:17 -03:00
Sarah Boyce
af6ed55fcd Separated creating the release and setting it as default in Trac in the post-release steps. 2025-06-27 09:46:17 -03:00
Mike Edmunds
23529b6627 Fixed #36478 -- Fixed inconsistent mail attachment handling.
Fixed an inconsistency between EmailMessage.attach() and .attachments
when attaching bytes content with a text/* mimetype. The attach()
function decodes UTF-8 bytes if possible and otherwise changes the
mimetype to application/octet-stream to preserve the content's unknown
encoding (refs #27007). Providing equivalent content directly in
EmailMessage.attachments did not apply the same logic, leading
to an "AttributeError: 'bytes' object has no attribute 'encode'"
in SafeMIMEText.set_payload().

Updated EmailMessage._create_mime_attachment() to match attach()'s
handling for text/* mimetypes with bytes content. Updated test cases
to accurately cover behavior on both paths.
2025-06-26 08:54:01 +02:00
michalpokusa
68a45d9a80 Fixed #36386 -- Added styles and icons for INFO and DEBUG messages in the admin. 2025-06-25 12:46:58 +02:00
Mariusz Felisiak
7091801e04 Fixed #36471 -- Added support for __coveredby GIS lookup and Collect, GeoHash, IsValid on MariaDB 12.0.1+. 2025-06-25 08:58:22 +02:00
Jacob Walls
b2407e4d7d Fixed #35305 -- Avoided recreating constraints on fields renamed via db_column. 2025-06-23 14:06:14 +02:00
Tim Graham
54402a7529
Removed @skipIfDBFeature silencing of nonexistent features.
Follow up to f5df7ed7e62585c7d0289a88a327dab8d608efcf.
2025-06-21 14:51:34 +02:00
Tim Graham
f5df7ed7e6 Removed @skipUnlessDBFeature silencing of nonexistent features.
This was added in 46c7707e50400e237cbd774a31ad801669ca3905 but is
obsolete now that gis_tests are discovered separately. It's
error-prone to ignore mistyped names.
2025-06-20 17:16:22 +02:00
Jacob Walls
8ede411a81 Fixed #36152 -- Deprecated use of "%" in column aliases.
Unintentional support existed only on SQLite and Oracle.
2025-06-20 08:25:22 +02:00
Jacob Walls
56f468681a
Refs #35038 -- Reduced CreateModel/AlterConstraint operations when optimizing migrations. 2025-06-19 12:22:23 +02:00
Jake Howard
bc1bfe12b6
Clarified that only latest dependency versions are valid for security reports. 2025-06-18 11:04:34 -03:00
haileyajohnson
22506b2c16 Fixed #36465, Refs #35816 -- Disallowed '+' and '-' characters in template variable names.
Regression in 5183f7c287a9a5d61ca1103b55166cda52d9c647.

Thank you to Jon Banafato and Baptiste Mispelon for the report.
2025-06-18 14:04:39 +02:00
Lukas Komischke
db4d65f8be Fixed #36467 -- Removed leading whitespaces from Set-Cookie header values in WSGIHandler.
This also aligned the Set-Cookie logic in the WSGIHandler and ASGIHandler.

Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2025-06-18 11:25:14 +02:00
Sarah Boyce
1cd91d5d4b Refs #36467 -- Added test for Set-Cookie header values in ASGIHandler. 2025-06-18 11:25:14 +02:00
michalpokusa
1520870c4a Fixed #36437 -- Improved accessibility of messages in admin. 2025-06-18 08:37:44 +02:00
Clifford Gama
74b31cd26b Fixed #32770 -- Added system check to ensure django.contrib.postgres is installed when using its features.
Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS
when using:
* PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField),
* PostgreSQL indexes (PostgresIndex and all subclasses), and
* ExclusionConstraint

The check provides immediate feedback during system checks rather than failing
later with obscure runtime and database errors.

Thanks to Simon Charette and Sarah Boyce for reviews.
2025-06-18 08:36:49 +02:00
nessita
8c56e93975
Refs #36009 -- Added GitHub action workflow to run tests with latest stable postgis version. 2025-06-17 15:25:47 -03:00
nessita
0f60102444
Added guidance on AI-assisted security reports to docs/internals/security.txt.
Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
2025-06-17 11:45:03 -03:00