1
0
mirror of https://github.com/django/django.git synced 2025-09-11 03:29:12 +00:00

3332 Commits

Author SHA1 Message Date
Mike Edmunds
0231f71d31 Fixed #36524 -- Enabled docs cross references to EmailMessage methods.
Updated docs for class django.core.mail.EmailMessage to use Sphinx
`method::` directives, allowing cross references to those methods
elsewhere in the docs.

Updated references to those methods in the email docs and 6.0 release
notes to link directly to the specific methods.
2025-09-05 15:56:16 -04:00
Mike Edmunds
7319341a88 Removed redundant directive in email docs.
docs/topics/email.txt declares `module:: django.core.mail`.
Removed unnecessary `currentmodule::` pointing to the same module.
2025-09-05 15:56:16 -04:00
Mustafa Pirbhai
183fcebf88 Fixed #35831 -- Documented the model form meta API in model form reference docs.
Co-authored-by: Jonathan <3218047+jernwerber@users.noreply.github.com>
Co-authored-by: Mustafa <117516335+mspirbhai@users.noreply.github.com>
2025-08-29 08:58:58 +02:00
Rob Hudson
550822bcee Fixed #36532 -- Added Content Security Policy view decorators to override or disable policies.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-08-28 17:23:48 -03:00
Adam Johnson
56955636e6 Ensured :doc: role uses absolute targets in docs. 2025-08-28 13:48:32 -03:00
SaJH
3c0c54351b Fixed #36570 -- Removed unnecessary :py domain from documentation roles.
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-28 08:52:43 +02:00
David Smith
f81e6e3a53 Refs #36485 -- Rewrapped docs to 79 columns line length.
Lines in the docs files were manually adjusted to conform to the
79 columns limit per line (plus newline), improving readability and
consistency across the content.
2025-08-25 10:51:10 -03:00
Natalia
4286a23df6 Refs #36485 -- Removed double spaces after periods in sentences. 2025-08-25 10:51:10 -03:00
David Smith
724e5ec6f2 Refs #36485 -- Fixed dangling hyphen and unbalanced inline markup in docs. 2025-08-25 10:51:10 -03:00
David Smith
6f8e23d1c1 Refs #36485 -- Removed unnecessary parentheses in :meth: and :func: roles in docs. 2025-08-25 10:51:10 -03:00
mengxun
f5c944b314
Fixed spelling of "logged-in" when used as an adjective in docs. 2025-08-19 12:43:05 -03:00
farhan
5e06b97095 Fixed #36410 -- Added support for Template Partials to the Django Template Language.
Introduced `{% partialdef %}` and `{% partial %}` template tags to
define and render reusable named fragments within a template file.
Partials can also be accessed using the `template_name#partial_name`
syntax via `get_template()`, `render()`, `{% include %}`, and other
template-loading tools.

Adjusted `get_template()` behavior to support partial resolution, with
appropriate error handling for invalid names and edge cases. Introduced
`PartialTemplate` to encapsulate partial rendering behavior.

Includes tests and internal refactors to support partial context
binding, exception reporting, and tag validation.

Co-authored-by: Carlton Gibson <carlton@noumenal.es>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2025-08-14 21:53:14 -03:00
Rohit
fa804d0d14 Corrected code examples in topics docs. 2025-08-11 10:12:43 +02:00
Adam Zapletal
dca8284a37 Corrected assertNumQueries() example in docs/topics/testing/tools.txt. 2025-08-04 15:07:48 +02:00
Mike Edmunds
9ab1991689 Fixed #35581 -- Updated django.core.mail to Python's modern email API.
- Changed EmailMessage.message() to construct a "modern email API"
  email.message.EmailMessage and added policy keyword arg.
- Added support for modern MIMEPart objects in EmailMessage.attach()
  (and EmailMessage constructor, EmailMessage.attachments list).
- Updated SMTP EmailBackend to use modern email.policy.SMTP.

Deprecated:
- Attaching MIMEBase objects (replace with MIMEPart)
- BadHeaderError (modern email uses ValueError)
- SafeMIMEText, SafeMIMEMultipart (unnecessary for modern email)
- django.core.mail.forbid_multi_line_headers()
  (undocumented, but exposed via `__all__` and in wide use)
- django.core.mail.message.sanitize_address()
  (undocumented, but in wide use)

Removed without deprecation (all undocumented):
- EmailMessage.mixed_subtype
- EmailMultiAlternatives.alternative_subtype
- Support for setting (undocumented) EmailMessage.encoding property
  to a legacy email.charset.Charset object

Related changes:
- Dropped tests for incorrect RFC 2047 encoding of non-ASCII email
  address localparts. This is specifically prohibited by RFC 2047, and
  not supported by any known MTA or email client. (Python still
  mis-applies encoded-word to non-ASCII localparts, but it is a bug that
  may be fixed in the future.)
- Added tests that try to discourage using Python's legacy email APIs
  in future updates to django.core.mail.
2025-07-25 13:50:02 +02:00
Mike Edmunds
f551aeb003 Fixed typo in docs/topics/email.txt. 2025-07-25 13:30:59 +02: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
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
Sarah Boyce
8e2249bc79 Corrected jsonfield fieldlookup references. 2025-06-13 09:50:56 +02:00
Clifford Gama
95a5c9b794
Made minor grammar and punctuation fixes in docs/topics/migrations.txt. 2025-06-11 12:52:26 -03:00
Jacob Walls
76e1ca77bc Refs #373 -- Doc'd that on_delete is ignored for ForeignObject. 2025-06-10 09:44:40 +02:00
Jacob Walls
5942754769 Fixed #36449 -- Fixed field types in example model using ForeignObject. 2025-06-10 09:44:40 +02:00
ontowhee
ddb8529415 Fixed #34262 -- Added support for AnyValue for SQLite, MySQL, Oracle, and Postgresql 16+.
Thanks Simon Charette for the guidance and review. Thanks Tim Schilling for the
documentation review. Thanks David Wobrock for investigation and solution proposals.
2025-05-20 10:01:42 +02:00
Simon Charette
e03e5c751c Fixed #33312 -- Raised explicit exception when copying deferred model instances.
Previously save() would crash with an attempted forced update message, and both
save(force_insert=True) and bulk_create() would crash with DoesNotExist errors
trying to retrieve rows with an empty primary key (id IS NULL).

Implementing deferred field model instance copying might be doable in certain
cases (e.g. when all the deferred fields are db generated) but that's not
trivial to implement in a backward compatible way.

Thanks Adam Sołtysik for the report and test and Clifford for the review.
2025-05-16 08:13:57 +02:00
savanto
8620a3b0c7 Fixed #36085 -- Added JSONField support for negative array indexing on SQLite. 2025-05-14 13:21:18 +02:00
Clifford Gama
9d93e35c20 Fixed #17461 -- Doc'd the presumed order of foreign keys on the intermediary model of a self-referential m2m.
Thanks Giannis Terzopoulos and Sarah Boyce for the reviews.
2025-05-02 07:56:56 +01:00
dbogar89
7b394b9988
Fixed #36335 -- Fixed typo in docs/topics/db/managers.txt. 2025-04-27 08:40:14 +02:00
Ahmed Nassar
be402891cd Fixed #36311 -- Unified spelling of "hardcode" and its variants in docs.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-04-15 14:48:55 -03:00
Ahmed Nassar
8bca33f68a Fixed #36269 -- Documented how to test callable storage in FileField. 2025-04-15 10:05:59 +02:00
Ahmed Nassar
2c2f090555 Fixed #35993 -- Documented gettext f-string support limitations.
Thank you to Claude Paroz and Athena Wolfskämpf for the review.
2025-04-15 10:02:25 +02:00
Song Junho
126417be43 Fixed #36265 -- Added support for serialization of ZoneInfo instances in migrations. 2025-03-31 13:44:54 +02:00
mguegnol
e2b9a17913
Fixed typo in docs/topics/signals.txt. 2025-03-23 20:02:42 +01:00
Clifford Gama
6a2c296e70 Fixed #36095 -- Introduced lazy references in "Models across files" section. 2025-03-21 14:09:10 +01:00
Carlton Gibson
8713e4ae96 Fixed #33497 -- Doc'd that persistent DB connections should be disabled in ASGI and async modes. 2025-03-18 21:26:57 -03:00
Clifford Gama
304e9f3d6a
Fixed #36202 -- Added examples of JSONField __contains and __contained_by lookups with nested arrays to docs. 2025-03-18 21:54:10 +01:00
YQ
30e0a43937 Fixed #36254 -- Fixed template dictionary unpacking in docs/topics/i18n/timezones.txt. 2025-03-17 09:45:15 +01:00
Clifford Gama
efe3ca09e0
Fixed incorrect formatting for inline pluralized code references in docs. 2025-03-13 15:18:35 -03:00
hesham hatem
e03440291b
Fixed #36249 -- Fixed typo in docs/topics/db/queries.txt. 2025-03-12 18:09:04 -03:00
Clifford Gama
0ebea6e5c0 Fixed #35676 -- Made BaseModelForm validate constraints that reference an InlineForeignKeyField.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-03-12 09:16:15 +01:00
Clifford Gama
ae2736ca3b Fixed #36128 -- Clarified auto-generated unique constraint on m2m through models. 2025-03-04 13:06:09 +01:00
Tim Graham
6d1cf5375f
Added some heading labels to to docs/topics/cache.txt. 2025-03-02 19:55:04 +01:00
Sarah Boyce
5935336059 Added security reporting guidelines. 2025-02-24 08:51:08 +01:00
Mariusz Felisiak
65c46d6932
Fixed #35358, Refs #35234 -- Renamed _check() methods to check() for constraints. 2025-02-19 20:27:30 +01:00
Mariusz Felisiak
efb7f9ced2
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
2025-02-18 08:35:36 +01:00
Simon Charette
2d34ebe49a Refs #35967 -- Deprecated BaseDatabaseCreation.create_test_db(serialize).
Given there are no longer any internal usages of serialize=True and it
poses a risk to non-test databases integrity it seems appropriate to
deprecate it.
2025-02-16 08:43:42 +01:00
Simon Charette
99ac8e2589 Refs #35967 -- Doc'd DatabaseCreation.serialize_db_to_string() method. 2025-02-16 08:37:55 +01:00
Mariusz Felisiak
d9af197801
Refs #36005 -- Bumped minimum supported versions of 3rd-party packages.
This bumps minimum supported versions of 3rd-party packages to the first
releases to support Python 3.12.
2025-01-28 08:02:13 +01:00
Georgi Yanchev
64b1ac7292 Fixed #24529 -- Allowed double squashing of migrations.
Co-authored-by: Raphael Gaschignard <raphael@rtpg.co>
2025-01-22 10:56:30 +01:00