old_contents: from appenlight_client.utils import import_module, deco_func_or_method
  from appenlight_client.timing import time_trace
  
  ignore_set = frozenset()
  
  
  def add_timing(min_duration=0.15):
      module = import_module('django')
      if not module:
          return
  
      from django import template
  
      def gather_template(template, *args, **kwargs):
          return {'type': 'tmpl',
                  'subtype': 'django',
                  'statement': 'render',
                  'count': True,
                  'parameters': '',
                  'ignore_in': ignore_set}
  
      if hasattr(template.Template, 'render'):
          deco_func_or_method(template, 'Template.render', time_trace,
                              gatherer=gather_template, min_duration=min_duration, is_template=True)
      elif hasattr(template.Template, '_render'):
          deco_func_or_method(template, 'Template._render', time_trace,
                              gatherer=gather_template, min_duration=min_duration, is_template=True)
  
new_contents: from appenlight_client.utils import import_module, deco_func_or_method
  from appenlight_client.timing import time_trace
  
  ignore_set = frozenset()
  
  
  def add_timing(min_duration=0.15):
      module = import_module('django')
      if not module:
          return
  
      from django import template
  
      def gather_template(template, *args, **kwargs):
          try:
              tmpl_name = str(template.name)
          except Exception as e:
              tmpl_name = ''
          return {'type': 'tmpl',
                  'subtype': 'django',
                  'statement': 'render',
                  'count': True,
                  'parameters': tmpl_name,
                  'ignore_in': ignore_set}
  
      if hasattr(template.Template, 'render'):
          deco_func_or_method(template, 'Template.render', time_trace,
                              gatherer=gather_template, min_duration=min_duration, is_template=True)
      elif hasattr(template.Template, '_render'):
          deco_func_or_method(template, 'Template._render', time_trace,
                              gatherer=gather_template, min_duration=min_duration, is_template=True)
  
subject: add django template name