Opened 16 hours ago

Last modified 11 hours ago

#36028 closed New feature

Add option to choose a specific template engine for Django Admin — at Version 3

Reported by: Foucauld Degeorges Owned by:
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: template engine
Cc: Adam Johnson Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Foucauld Degeorges)

Context:
We have two template engines in our app - one that is permissive with invalid variables (e.g. accessing a property on None), the other one raises on invalid variables.
Django Admin requires the permissive one as it makes use of the fallback mechanic on invalid variables.

But we prefer for all our other renders (views, emails, PDFs) to be strict on invalid variables. So we want our strict template engine to be the default one, and specify a custom one for the admin.

The idea would be an optional property on AdminSite named template_engine, that sets the using argument of all TemplateResponses returned by admin views.

Change History (3)

comment:1 by Foucauld Degeorges, 16 hours ago

Keywords: template engine added

comment:2 by Foucauld Degeorges, 16 hours ago

Summary: Add option to choose a template engineAdd option to choose a specific template engine for Django Admin

comment:3 by Foucauld Degeorges, 15 hours ago

Description: modified (diff)
Has patch: set
Note: See TracTickets for help on using tickets.
Back to Top