summaryrefslogtreecommitdiff
path: root/docs/topics
AgeCommit message (Collapse)Author
7 daysFixed #37196 -- Documented SimpleTestCase.async_client_class and ↵VIZZARD-X
async_client in testing tools.
10 daysRefs #28586 -- Renamed RAISE fetch mode to FETCH_RAISE.Jacob Walls
This aims for consistency in the django.db.models namespace. Thanks Natalia Bidart and Simon Charette for the idea.
2026-07-24Fixed typo and versionadded locations in email docs.Mike Edmunds
* Moved versionadded annotation to top of `mailers` section. * Added versionadded to `mailers.default` to help avoid confusion over deprecated annotation in same entry. * Added missing "a" in `get_connection()` deprecation note.
2026-07-24Fixed minor typos and grammatical errors in docs and docstrings.Jacob Walls
Thanks to these people for pointing these out: * Hojeong Park * Natalia Bidart * Sulav Raj Bista
2026-07-20Refs #15855 -- Documented that cache_page caches responses before response ↵Sarah Boyce
middleware runs.
2026-07-16Fixed #37218 -- Doc'd that on-demand fetching is sync only.Jacob Walls
2026-07-14Fixed #37210 -- Logged cached_db session cache delete failures.vismaytiwari
2026-07-14Fixed #37131 -- Improved XSS section in security documentation.VIZZARD-X
Co-authored-by: Daniele Procida <evildmp@users.noreply.github.com> Co-authored-by: James Bligh <blighj@users.noreply.github.com>
2026-07-13Fixed #37178 -- Moved MiddlewareMixin out of utils.deprecation.CharulL00
2026-07-06Fixed #37172 -- Linked to upload handlers section in FILE_UPLOAD_* settings ↵Lincoln Puzey
see for details.
2026-07-01Fixed #34753 -- Extended security and safety remarks in email topics docs.Mike Edmunds
Reworked the outdated "Preventing header injection" section: * Added a "Safely sending email" section noting that the topic is relevant but beyond the scope of Django's own docs. * Added a section on correctly formatting email addresses with a variable display name to avoid injection attacks. * Updated the existing "Preventing header injection" section to note that Django (via Python) already prevents CRLF injection, but that custom email backends that bypass Django's protections may need to handle it. Also added references to the new "Formatting email addresses" section from the `ADMINS`, `DEFAULT_FROM_EMAIL`, and `SERVER_EMAIL` settings.
2026-06-30Fixed #37162 -- Updated ContactForm docs example to use safe practices.Mike Edmunds
Updated the `ContactForm` examples in the "Forms" topic and reference docs to avoid broken and unsafe practices around sending email: * Stopped using user-provided `sender` address as `from_email`. Instead, renamed to `contact_email` and used it as the `reply_to` address. * Removed `cc_myself` option to prevent using the form to send spam. Substituted an `urgent` field to demonstrate `BooleanField` use. * Identified email as coming from the contact form and added other content to reduce impersonation/phishing risks. Also updated some example output in the forms reference docs where it had drifted from the example code over time: email fields default to `maxlength=320`; the `ContactForm` example has been using a `TextArea` widget for its message field.
2026-06-26Clarified "plaintext" vs. "plain-text" in password hashers docs.Mike Edmunds
Replaced "plain-text" with "plaintext" where it is used to describe the unencrypted input to a password hashing function. (In a cryptography context this is the preferred spelling, and it is already used that way in Django's release notes.) This reduces ambiguity about whether make_password() expects UTF-8 encoded Unicode text ("plain-text bytes") or the unencrypted material for the user's password ("plaintext bytes"). (See #37184.) All other current uses of "plain text" and "plain-text" in docs and docstrings (including the one elsewhere in passwords.txt) are describing text that is plain (unformatted; not rich text).
2026-06-24Refs #37174 -- Doc'd that args to the {% cache %} tag are stringified.Jacob Walls
2026-06-23Removed additional versionchanged notices for 6.0.Jacob Walls
2026-06-19Fixed #37165 -- Updated Async Support topics doc.Carlton Gibson
Removed outdated warnings, and updated performance considerations to reflect current realities. Thanks to Mykhailo Havelia for the detailed review.
2026-06-16Fixed #37152 -- Raised ValueError when Bcc is used in EmailMessage headers.diaxoaine
Bcc addresses are sent via the SMTP envelope and must never appear in the message itself. A "Bcc" key in `extra_headers` was not excluded like From/To/Cc/Reply-To, so it leaked into the generated message as a visible header. Thanks Mike Edmunds for reviews.
2026-06-16Fixed typo in section "Configuring email" in docs/topics/email.txt.Mike Edmunds
2026-06-15Fixed password hashing anchor link for references.Tim Schilling
2026-06-15Fixed #37128 -- Doc'd setUpTestData as test speed up.Tim Schilling
Revises the AnimalTestCase to better show test data isolation and avoid the opportunity to use setUpTestData.
2026-06-11Fixed #37129 -- Clarified database cache culling behavior in docs.VIZZARD-X
2026-06-11Fixed #36837 -- Skipped backends not implementing (a)get_user() in ↵Sezer BOZKIR
(a)force_login(). Co-authored-by: Mykhailo Havelia <Arfey17.mg@gmail.com>
2026-06-08Fixed #32785 -- Optimized cull frequency for DBCache.eevelweezel
2026-06-03Fixed CVE-2026-35193 -- Varied on Authorization when caching non-public ↵Jacob Walls
responses. Thanks Shai Berger for the report, and Natalia Bidart and Sarah Boyce for reviews.
2026-05-27Fixed #35596 -- Removed mention of unlimited results from QuerySet.get().CodeQuiver
Obsolete since 330638b89f14e1fb06e9d313ccc9768ae167c53f.
2026-05-27Fixed #37065 -- Doc'd method_decorator usage on dispatch for async views.Carlton Gibson
2026-05-25Corrected indentation in topics/http/shortcuts.txt.Mariusz Felisiak
2026-05-20Removed versionadded/changed annotations for 6.0.Sarah Boyce
2026-05-20Fixed #37045 -- Renamed savepoint() to savepoint_create().Samuel Searles-Bryant
This makes the name consistent with the `savepoint_commit` and `savepoint_rollback` functions. The previous name is maintained as a deprecated alias. This also frees up the `savepoint` name, which would allow the context manager from `django-subatomic` to be included in Django. Co-authored-by: Lily <code@lilyf.org>
2026-05-20Refs #35514 -- Cleaned up mailers docs.Mike Edmunds
* Fixed typos related to automated EMAIL_PROVIDERS -> MAILERS renaming. * Clarified wording in some recently added/updated sections. * Removed deprecated, extraneous `fail_silently=False` from examples. * Moved EmailBackend API documentation out of "Email backends" intro into a dedicated section in email.txt. * Sorted MAILERS alphabetically in settings.txt.
2026-05-13Fixed #35514 -- Implemented dictionary-based MAILERS.Mike Edmunds
See DEP 0018. Added: * MAILERS setting. * django.core.mail.mailers dict-like EmailBackend factory. * `using` argument to mail sending APIs. * `sent_using` attribute to mail.outbox messages in locmem backend. * MAILERS in startproject settings template, set to console backend. * AdminLogHandler.using argument. * BrokenLinkEmailsMiddleware.send_mail() method. Updated: * BaseEmailBackend to track the MAILERS alias used to construct it, and to report errors for unknown kwargs (OPTIONS). * EmailBackend implementations to initialize from kwargs (OPTIONS) only when MAILERS is being used. * smtp.EmailBackend to require `host` option and to default `port` option based on SSL/TLS options. * SimpleTestCase setup to substitute the locmem backend for all defined MAILERS configurations. * Django's tests that send mail to define MAILERS. Deprecated: * EMAIL_BACKEND and other backend-related EMAIL_* settings. * mail.get_connection(). * The `connection`, `fail_silently`, `auth_user`, and `auth_password` arguments to mail functions. * The EmailMessage.connection attribute. * BaseEmailBackend support for `fail_silently`. Backends that support fail_silently (SMTP, console, file) now implement it directly. * AdminEmailHandler.email_backend argument. Removed undocumented features without deprecation: * EmailMessage.get_connection() method. (send() now raises an error if a subclass has attempted to override it.) * EmailMessage.send() no longer sets self.connection to the connection used for sending. (It still _uses_ a pre-existing self.connection.) * AdminEmailHandler.connection() method. (Init now raises an error if a subclass has attempted to override it.) Thanks to Natalia Bidart for shepherding DEP 0018 and for extensive reviews and suggestions on the implementation. Thanks to Jacob Rief for the initial implementation and multiple iterations while refining the design. Co-authored-by: Jacob Rief <jacob.rief@gmail.com>
2026-05-11Fixed typo in docs/topics/db/search.txt.Stephanie
2026-05-07Fixed #37085 -- Added support for object-based form media stylesheet assets.Natalia
Thank you James Walls and James Bligh for reviews. Co-authored-by: Johannes Maron <johannes@maron.family>
2026-05-06Fixed #36784 -- Added csp_nonce_attr template tag for CSP nonce inclusion.Natalia
New default tag `{% csp_nonce_attr %}` was added for explicit CSP nonce inclusion into `<script>` and `<link>` elements. `{% csp_nonce_attr %}` renders `nonce="<value>"` when `csp_nonce` is present in the template context, and renders nothing otherwise. `{% csp_nonce_attr media %}` renders a `Media` object's assets with the nonce attr applied to each tag. Thanks Jacob Walls for the accurate and spot on review comments. Co-authored-by: Johannes Maron <johannes@maron.family>
2026-05-04Fixed #36767 -- Allowed max redirect URL length to be set on ↵varunkasyap
HttpResponseRedirect.
2026-04-24Replaced references in docs to accepted PEPs with specific Python docs links.Mike Edmunds
Where the docs used `:pep:` links for established Python language features, replaced them with direct references to the Python docs (usually glossary terms).
2026-04-20Refs #373, #34122 -- Removed warning that ForeignObject is an internal tool.Mariusz Felisiak
ForeignObject should not be treated as an internal tool. In the past we made changes in its API with a proper deprecation, e.g. 8b1ff0da4b162e87edebd94e61f2cd153e9e159d.
2026-04-16Refs #35514 -- Cleaned up email docs.Mike Edmunds
* Indented get_connection() details into its function block. * Updated introductory paragraph to better reflect current capabilities. * Changed link in "Quick examples" to go to descriptive text rather than reference for send_mail(). * Avoided implying that send_mail() is only reliable "in most cases." * Improved description of development SMTP server. * Expanded information on third-party backends. * Moved "Email backends" introductory paragraph above API methods and expanded it to match section content.
2026-04-16Refs #35514 -- Added "Configuring email" section to email docs.Mike Edmunds
2026-04-16Refs #35514 -- Moved and renamed "Sending multiple emails" in email docs.Mike Edmunds
Moved "Sending multiple emails" from the "Email backends" section to the "Sending messages" section and renamed it to "Sending many messages efficiently" to better reflect its content. Moved the related connection manager example from the "Email backends" intro into the same section.
2026-04-16Refs #35514 -- Moved get_connection() after backends in email docs.Mike Edmunds
Moved "Obtaining an instance of an email backend" after documentation for individual backends (matching similar approach in Tasks docs).
2026-04-15Refs #35514 -- Corrected email backends' outline levels in email docs.Mike Edmunds
Moved documentation section for each email backend to be a direct child of "Email backends" (rather than subsections of "Obtaining an instance of an email backend"). Added a section header for "Third-party backends" to surface it in the outline and separate it from "Dummy backend."
2026-04-15Refs #35514 -- Moved EmailMessage class up in email docs.Mike Edmunds
Moved the "Preventing header injection" discussion below sections on EmailMessage and related classes.
2026-04-15Refs #35514 -- Grouped sending-related features in email docs.Mike Edmunds
Introduced a top-level "Sending messages" section to group together send_mail(), send_mass_mail(), mail_admins(), mail_managers(), the EmailMessage and EmailMultiAlternatives classes, and other topics related to sending.
2026-04-15Refs #35514 -- Moved email docs examples to relevant section.Mike Edmunds
The top-level "Examples" section of docs/topics/email.txt seemed intended to illustrate the difference between send_mail() and send_mass_mail(), not to provide general examples of sending email. Moved it into the existing "send_mass_mail() vs. send_mail()" section. (There's already a "Quick examples" section at the top of the page with general examples.)
2026-04-15Fixed broken link in email docs.Mike Edmunds
2026-04-15Fixed incomplete comment in email docs.Natalia
2026-04-07Fixed #37021 -- Added Permission.user_perm_str property.mariatta
For use in checking user permissions via has_perm(). Co-authored-by: 사재혁 <jaehyuck.sa.dev@gmail.com>
2026-04-07Refs CVE-2026-33034 -- Improved security documentation on handling large ↵Jake Howard
request bodies. Notably that the limit can be bypassed under ASGI.
2026-03-28Fixed #29762 -- Doc'd how database routers fetch related objects.VIZZARD-X
Thanks James Bligh for the review. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>