django/django/template
farhan 5e06b97095
Some checks failed
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Docs / spelling (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
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
..
backends Fixed #35233 -- Moved template engine system checks to backend methods. 2024-03-27 08:14:54 +01:00
loaders Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
__init__.py Fixed #36410 -- Added support for Template Partials to the Django Template Language. 2025-08-14 21:53:14 -03:00
autoreload.py Fixed #34878 -- Fixed autoreloader crash when FORM_RENDERER is set to TemplatesSetting. 2023-09-29 06:01:04 +02:00
base.py Fixed #36410 -- Added support for Template Partials to the Django Template Language. 2025-08-14 21:53:14 -03:00
context.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
context_processors.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
defaultfilters.py Fixed #36519 -- Made center template filter consistent for even/odd padding. 2025-07-28 16:41:06 -03:00
defaulttags.py Fixed #36410 -- Added support for Template Partials to the Django Template Language. 2025-08-14 21:53:14 -03:00
engine.py Fixed #36410 -- Added support for Template Partials to the Django Template Language. 2025-08-14 21:53:14 -03:00
exceptions.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
library.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
loader.py Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
loader_tags.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
response.py Refs #28909 -- Simplified code using unpacking generalizations. 2025-03-31 22:43:13 -03:00
smartif.py Refs #36500 -- Rewrapped long docstrings and block comments via a script. 2025-07-23 20:17:55 -03:00
utils.py Applied optimizations to template.utils.get_app_template_dirs(). 2024-07-22 08:38:46 +02:00