I have 2 applications in the django project. I want to add different widgets in the change_list.html for the 2 different applications. In settings.py, after adding the change_list.html in the admin directory of the templates in both the applications respectively as,
TEMPLATE_DIRS = (
“/home/path/project/application1/templates”,
“/home/path/project/application2/templates”,
)
I notice that the change_list.html template considered is from the application1. Only if I comment it, the template from application2 is considered. How to go about? I want both of them to be considered for the 2 different applications. Please suggest.
Read the section on overriding admin templates: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates (more specifically https://docs.djangoproject.com/en/dev/ref/contrib/admin/#templates-which-may-be-overridden-per-app-or-model)
Place your
change_list.htmlinadmin/application1in one of the folders parsed byTEMPLATE_DIRSor one of the template loaders and that template will be served only forapplication1.Your current code is always telling django to prioritize matches on the first path over the second.