Opened 5 years ago

Closed 3 years ago

#16096 closed New feature (fixed)

Template instances should have an origin attribute.

Reported by: jdunck Owned by: nobody
Component: Template system Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Templates are constructed with an optional origin argument; this is used for debugging purposes.

But I think it would be useful for the Template instance to have an origin attribute -- then template origins could be more easily inspected and logged outside the django.template infrastructure. The specific use case I have in mind is making it clearer to FE devs which templates/template dirs are being used for a given request.

Template's constructor receives an origin parameter, so this should be a simple change.

Change History (5)

comment:1 Changed 5 years ago by julien

  • Triage Stage changed from Unreviewed to Accepted

This makes sense and it can't hurt. Are you thinking of any particular API other than just setting the origin attribute to the Template instance?

comment:2 Changed 5 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:3 Changed 3 years ago by prestontimmons

I added a pull request for this here.

comment:4 Changed 3 years ago by timo

  • Has patch set
  • Patch needs improvement set

comment:5 Changed 3 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 8625c7aab3760d16572792fea23a95e572e28ead:

Fixed #16096 -- Added origin attribute to template instances.

Thanks jdunck for the suggestion.

Note: See TracTickets for help on using tickets.
Back to Top