@require_template_debug<EOL>@register.simple_tag(takes_context=True)<EOL>def set_trace(context):
try:<EOL><INDENT>import ipdb as pdb<EOL><DEDENT>except ImportError:<EOL><INDENT>import pdb<EOL>print("<STR_LIT>")<EOL><DEDENT>print("<STR_LIT>")<EOL>render = lambda s: template.Template(s).render(context)<EOL>availables = get_variables(context)<EOL>pprint(availables)<EOL>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>for var in availables:<EOL><INDENT>locals()[var] = context[var]<EOL><DEDENT>pdb.set_trace()<EOL>return '<STR_LIT>'<EOL>
Start a pdb set_trace inside of the template with the context available as
'context'. Uses ipdb if available.