#36410 closed New feature (fixed)
Add named template partials to the DTL.
Reported by: | Carlton Gibson | Owned by: | Farhan Ali |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Normal | Keywords: | partials |
Cc: | Carlton Gibson, Farhan Ali | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Completing the cycle begun in 2023, incorporate named template partials into the Django Template Language.
Starting with the forum discussion on Adding template fragments or partials for the DTL we added the internal structures necessary for template partials in #34883.
The third-party django-template-partials package, first released during the Django 4.2 cycle, has battle-tested the implementation over a full LTS cycle, and gained significant community uptake.
The project to merge this into Django was accepted for GSoC 2025, with Farhan Ali Raza implementing it.
The project is to merge to the two template tags, for defining and rendering a partial, plus the integration with template loader, so that partial fragments can be loaded by name. A migration guide will be added to the django-template-partials repo for existing users.
Change History (16)
comment:1 by , 3 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 7 weeks ago
Cc: | added |
---|---|
Has patch: | set |
comment:3 by , 6 weeks ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
comment:4 by , 6 weeks ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:5 by , 6 weeks ago
Patch needs improvement: | set |
---|
comment:6 by , 6 weeks ago
Patch needs improvement: | unset |
---|
comment:7 by , 5 weeks ago
Patch needs improvement: | set |
---|
comment:8 by , 4 weeks ago
Patch needs improvement: | unset |
---|
comment:9 by , 4 weeks ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
comment:10 by , 3 weeks ago
Patch needs improvement: | unset |
---|
comment:11 by , 3 weeks ago
Needs tests: | unset |
---|
comment:12 by , 3 weeks ago
Patch needs improvement: | set |
---|
comment:13 by , 3 weeks ago
Patch needs improvement: | unset |
---|
comment:14 by , 3 weeks ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:16 by , 2 weeks ago
Keywords: | partials added |
---|
There are a couple of comments remaining about code moving. But it is not clear what decision is made about those.