This is a tornado template (say, in the file logout.html) I render on an error in the logout process:
{% if logout_error %} Oops! The logout failed. Please
The "Tornado way" is to not have undeclared variables. It's more zen to declare the variables explicit.
Workaround:
{% if 'grok' in globals() %} {{grok}} {% end %} {% if globals().get('grok_error', False) %} error message {% end %}