'Overridden method for locating a template in either the database or the site theme.
If not found, template lookup will be done in comprehensive theme for current site
by prefixing path to theme.
e.g if uri is `main.html` then new uri would be something like this `/red-theme/lms/static/main.html`
If still unable to find a template, it will fallback to the default template directories after stripping off
the prefix path to theme.'

def get_template(self, uri):

    template = themed_template(uri)
    if (not template):
        try:
            template = super(DynamicTemplateLookup, self).get_template(get_template_path_with_theme(uri))
        except TopLevelLookupException:
            template = super(DynamicTemplateLookup, self).get_template(strip_site_theme_templates_path(uri))
    return template
