I am currently just add app to INSTALLED_APPS to be able to use templates from that app, but there is also TEMPLATE_DIRS setting. When have I to prefer TEMPLATE_DIRS over INSTALLED_APPS?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use templates in TEMPLATE_DIRS to either override templates coming from apps (by giving them the same name) or for templates that are relevant for more than one app (base.html comes to mind).
This works because of the order in which template loaders are set in TEMPLATE_LOADERS (filesystem before app_directories).
It’s a good idea to organize your templates in the following way to avoid name collisions: