﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35233	Push templates checks down to backend engine classes	Adam Johnson	Giannis Terzopoulos	"Currently, the three system checks for template settings are individual functions in [https://github.com/django/django/blob/main/django/core/checks/templates.py django.core.checks.templates]. This structure leads to some issues:

1. The checks are specific to DTL (Django Template Language), but get run for all backends. DTL-specific code gets loaded and run even when not using it, notably the fairly slow `get_template_tag_modules()`.
2. `check_for_template_tags_with_the_same_name` is inaccurate because it combines `libraries` from all template backends, so might report an issue when none exists.
3. The checks are still run when no template backend is configured (`settings.TEMPLATES = []`).

I propose the checks be restructured to live within the engine classes in `django.template.backends`, adopting the same pattern used for model and field checks, admin checks, etc.

In practice, this would mean adding a dummy `BaseEngine.check()` method, then moving the existing checks into methods called by an overridden `DjangoTemplates.check()`. A single function left in `django.core.checks.templates` would loop over `django.template.engines.all()` to combine results from backends’ `check()` methods."	Cleanup/optimization	closed	Core (System checks)	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
