How to get the absolute file path of a template file from it's template name, without parsing the template?
E.g. given foo/bar.html
return home/user/project/app/foo/templates/foo/bar.html
The django.template.loader.get_template
will parse the template.
I think there was a django.template.loader.find_template
but it was deprecated.
Please note this is not a duplicate of How to get the template path in the view django because that solution parses the whole template, which is slow when trying to find the path of many template_name
s.
Please note the templates files are spread across various apps in various places, so it needs to use the template loader engine to find them. hard coding some dir with suffixes won't work.