Pre-Proposal GSoC 2026: Template ergonomics and missing variables

Hi everyone, I’m Abhimanyu Negi. I started learning Django in 2024 and have been contributing since the start of 2026. I currently have 1 merged PR (#20696) and a few other PRs under review.

I wanted to express my interest in the Template Ergonomics project.

As a small early implementation experiment, I built a private prototype for strict handling of missing template variables to validate how this behaviour could be introduced internally without changing the default template behaviour.

Prototype notes and code changes:

https://github.com/AbhimanyuGit2507/django/blob/strict-template-prototype/template-strict-mode-prototype.md

Based on the early prototype, I plan to validate behaviour against real template usage and edge cases. This includes checking compatibility impacts (admin and reusable templates) and refining the design before proposing changes in core Django.

My plan is to structure the work in the following phases:

  1. Optional Strict Mode for foundation:
    Without changing the default behaviour, I will implement an opt-in strict handling of missing template variables as the initial foundation.

  2. Define consistent behaviour across different contexts:
    I will define how missing variables should behave in different contexts, including direct rendering ({{ variable }}), conditionals ({% if variable %}), and loops ({% for x in variable %}). The intention is to ensure predictable and consistent behaviour instead of handling each case independently.

  3. Design API control:
    Then I will design a clean API for enabling and controlling strict behaviour. This may include per-template configuration or other explicit mechanisms that allow developers to adopt strict handling gradually while keeping compatibility with existing templates and third-party packages.

  4. Final Prototype implementation and validation: A new final working prototype will be built to validate the proposed behaviour against real template usage and edge cases. This phase will focus on testing how strict variable handling behaves across common template patterns, identifying compatibility impacts early (including reusable templates and admin use cases), and using those results to refine and finalize the design before implementation in core Django.

Apart from the Templates Ergonomics Project, the “Add types to parts of Django” project also sparked my interest, so I might share my Pre-proposal on that as well.

Any guidance, suggestions, or reading pointers would be greatly appreciated.

Thanks,

Abhimanyu Singh Negi

1 Like