def get_template_setting(template_key, default=None):
 templates_var = getattr(settings, u'TEMPLATES', None)
 if ((templates_var is not None) and (template_key in templates_var[0])):
  return templates_var[0][template_key]
 if (template_key == u'DIRS'):
  pre18_template_key = (u'TEMPLATES_%s' % template_key)
  value = getattr(settings, pre18_template_key, default)
  return value
 return default

def get_template_setting ( template_key , default = None ) : templates_var = getattr ( settings , u'TEMPLATES' , None ) if ( ( templates_var is not None ) and ( template_key in templates_var [ 0 ] ) ) : return templates_var [ 0 ] [ template_key ] if ( template_key == u'DIRS' ) : pre18_template_key = ( u'TEMPLATES_%s' % template_key ) value = getattr ( settings , pre18_template_key , default ) return value return default
read template settings pre and post django 1 .