Django: using html templates TemplateDoesNotExist
it should be:
template = loader.get_template("test/template.html")
I've been writing my first Django app and hit a problem with using templates.
No matter how I format the url for the template I receive the TemplateDoesNotExist error.
My html is nest in views/ with the core template being views/template.html.
I have tried:
myapp/views/template.html
views/template.html
templates/views/template.html
<full path to app>/<all variations>
None of which can locate the template.
I understand the TEMPLATE_DIRS variable may be set at project level but this is app-specific and the views/ directory is not purely for templates.
I don't think I should add to the url_patterns since the template shouldn't be accessible directly.
I've got this far without them but need to clean up the app.
Any advice?
Edit:
The only line in my controller currently is:
template = loader.get_template("test/templates/test/template.html")
The line has been tested with every variation mentioned above and the one from the first comment.
There are no additional lines added to the urlpatterns, as I understand it adding to here would open access up to the public via url.