Is there an available method to take a django template and see which objects it needs in the context to render without errors? Alternatively, is it possible to find out programatically, after rendering a template, if any bad template variables were present?
My goal is as follows. Imagine I have a template:
Hello {{ name }}.
Your lucky number is {{lucky_number}}
I would either like a list containing ‘name’ and ‘lucky_number’. Alternatively, if I render that template and provide a context with just ‘name’, I would like to know that ‘lucky_number’ was not provided.
I found this which can help me build my alternate solution:
http://excess.org/article/2012/04/paranoid-django-templates/