'Returns a path (string) to a Mako template, which can either be in
an override or will just return what is passed in which is expected to be a string'

def get_template_path(self, template_path, **kwargs):

    from microsite_configuration.microsite import get_value as microsite_get_value
    microsite_template_path = microsite_get_value('template_dir', None)
    if (not microsite_template_path):
        microsite_template_path = '/'.join([settings.MICROSITE_ROOT_DIR, microsite_get_value('microsite_config_key', 'default'), 'templates'])
    relative_path = (template_path[1:] if template_path.startswith('/') else template_path)
    search_path = os.path.join(microsite_template_path, relative_path)
    if os.path.isfile(search_path):
        path = '/{0}/templates/{1}'.format(microsite_get_value('microsite_config_key'), relative_path)
        return path
    else:
        return template_path
