raise an exception in jinja if we passed in a variable that is not present in the template

When you load your jinja2.Environment, set the ‘undefined’ parameter to ‘jinja2.StrictUndefined’, e.g.:

env = jinja2.Environment(loader=<someloader>, undefined=jinja2.StrictUndefined)

You can catch and examine the render exception to see what was missing

EDIT It would help if I read your full question. 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)