| Age | Commit message (Collapse) | Author |
|
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>
|
|
|
|
truncated_unordered_list filter.
|
|
deferred annotations.
Provide a wrapper for safe introspection of user functions on Python 3.14+.
Follow-up to 601914722956cc41f1f2c53972d669ddee6ffc04.
|
|
querystring template tag.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
Before, `context` and `content` were validated at compile time.
|
|
Ideally, this will be reverted when an upstream solution is available for
https://github.com/python/cpython/issues/141560.
Thanks Patrick Rauscher for the report and Augusto Pontes for the
first iteration and test.
|
|
|
|
urlize().
This case was inadvertently fixed in ad94446fcc5b50401dd0c48718502d5d1b92df58.
|
|
warning.
|
|
|
|
Added a warning for accessing PartialTemplate.source when debugging is disabled.
Thanks Sarah Boyce for the idea.
|
|
input.
Signed-off-by: SaJH <wogur981208@gmail.com>
|
|
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>
|
|
Refactored `center` template filter to match f-string behaviour,
producing consistent padding for both odd and even fillings.
Thanks Lily Acorn for the report and Natalia Bidart for the review.
Co-authored-by: Lily Acorn <code@lilyf.org>
|
|
tests/template_tests/filter_tests/test_center.py.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
SimpleBlockTagTests.test_simple_block_tag_with_context_missing_content().
|
|
variable names.
Regression in 5183f7c287a9a5d61ca1103b55166cda52d9c647.
Thank you to Jon Banafato and Baptiste Mispelon for the report.
|
|
Regression in 55d89e25f4115c5674cdd9b9bcba2bb2bb6d820b.
This work improves the django.utils.text.wrap() function to ensure that
empty lines and lines with whitespace only are kept instead of being
dropped.
Thanks Matti Pohjanvirta for the report and fix.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
|
|
template tag.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
path with an unknown origin.
|
|
Thanks Sarah Boyce for the report.
|
|
template_tests/syntax_tests/test_querystring.py.
|
|
urlizetrunc.
|
|
* Refs #35816 -- Improved test coverage of FilterExpression.
* Fixed #35816 -- Made FilterExpression parse scientific numbers.
---------
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
|
|
Thanks sw0rd1ight for the report.
|
|
|
|
template tag.
Thank you to David Feeley for the report and Natalia Bidart for the review.
|
|
Removed obsolete and potentially problematic IDNA 2003 ("punycode")
encoding of international domain names in smart_urlquote() and Urlizer,
which are used (only) by AdminURLFieldWidget and the urlize/urlizetrunc
template filters. Changed to use percent-encoded UTF-8, which defers
IDNA details to the browser (like other URLs rendered by Django).
|
|
|
|
Co-authored-by: Brock <bsmick97@gmail.com>
|
|
These extra tests assert over the handling of empty params (None, empty
dict, empty QueryDict), and also for dicts having non-string keys.
|
|
Thank you Sarah Boyce for the review and suggestions.
|
|
|
|
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
super objects are copyable on Python 3.14+:
https://github.com/python/cpython/commit/5ca4e34bc1aab8321911aac6d5b2b9e75ff764d8
and can no longer be used in BaseContext.__copy__().
|
|
in the template.
|
|
with __class_get_item__.
|
|
|
|
template filters.
Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report.
|
|
Thanks Michał Górny for the report.
|
|
Thanks Elias Myllymäki for the report.
Co-authored-by: Shai Berger <shai@platonix.com>
|
|
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
|
|
This follows previous renames made in 27043bde5b795eb4a605aeca1d3bc4345d2ca478.
|
|
|
|
|
|
that can be flattened.
|