def template_exists(template_name):
    '''
    Determine if a given template exists so that it can be loaded
    if so, or a default alternative can be used if not.
    '''
    try:
        template.loader.get_template(template_name)
        return True
    except template.TemplateDoesNotExist:
        return False
def template_exists ( template_name ) : try : template . loader . get_template ( template_name ) return True except template . TemplateDoesNotExist : return False
Determine if a given template exists so that it can be loaded
    if so, or a default alternative can be used if not.