def __init__(self, frame): file_name = _get_template_file_name(frame) self.back_context = frame.f_locals['context'] self.f_code = FCode('Django Template', file_name) self.f_lineno = _get_template_line(frame) self.f_back = frame self.f_globals = {} self.f_locals = self.collect_context(self.back_context) self.f_trace = None
def __init__(self, frame): file_name = _get_jinja2_template_filename(frame) self.back_context = None if 'context' in frame.f_locals: #sometimes we don't have 'context', e.g. in macros self.back_context = frame.f_locals['context'] self.f_code = FCode('template', file_name) self.f_lineno = _get_jinja2_template_line(frame) self.f_back = frame self.f_globals = {} self.f_locals = self.collect_context(frame) self.f_trace = None