@register_tag(takes_context=True)<EOL>def is_context_variable(context, variable_name):
return variable_name in context<EOL>
Returns true if the given variable name is in the template context.

Usage::

    {% is_context_variable "variable_name" as variable_exists %}
    {% if variable_exists %}
        ...
    {% endif %}