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
Hacking around using locals().get() is one way to do it. Another, bit more orthodox is using try. Tornado template supports it, so you can:
locals().get()
try
{% try %} {% if logout_error %} Oops! The logout failed. Please close all open documents and try again {% end %} {% except %} {% end %}