Seeking Advice on GSoC Project: Handling Missing Template Variables

I’m preparing for Google Summer of Code 2026 and I’m interested in the project idea: “Add ergonomic control over missing variables in templates.”

Currently, Django silently converts missing vari

ables in templates to an empty string. I’d like to improve this by allowing:

Global mode silent, strict (raise error), or debug (show placeholder)

Per-variable control –

Before I start, I’d love advice from the community:

Are there any best practices I should follow when extending the template engine?

What pitfalls should I watch out for when handling missing variables?

Are there similar existing approaches in Django I should study?

Any suggestions, tips, or references would be greatly appreciated!

Thank you for your guidance.

1 Like

Hi, the silent approach for dealing with missing variables in the template has always been a sore spot for quite a long time. I would recommend that you take a look at the string_if_invalid option already available, since this will be something very similar to what Django currently supports. The biggest danger here lies in the area of backward compatibility, since a lot of templates depend on the silent approach.

1 Like