This is the structure of my site:
mysite
app_a
templates
a.html
app_b
templates
b.html
views.py
In views.py, I want to get a.html,
So I use this :
return render_to_response('app_a/a.html')
but it shows an error :
TemplateDoesNotExist
What do I need to do?
just use render_to_response(‘a.html’)
Assuming you have the default app directory template loaders on, the problem is that the template path is actually
a.htmlSo in your current format, you would write
a.htmlnotapp_a/a.htmlThe recommended format for template directories is
which would work with your example of
app_a/a.htmlThe reason this format is recommended is so you can sanely override templates on a per-app basis.
You can easily get conflicting template names if all files are directly in the app template directory.