#18617 closed Uncategorized (fixed)
Pointing out a template overriding pitfall
Reported by: | Daniele Procida | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I spent a lot of time trying to work out why my own base_site.html template wasn't overriding Django's.
Eventually I realised that it was because django.contrib.admin was listed in INSTALLED_APPLICATIONS before my own application, and so its base_site.html won the race to be chosen.
I'm a slow learner, so I went through the same thing all over again today, a year or more later...
To help people like me, I have added a comment in the settings.py of the project template, and a note in the docs, in a pull request at https://github.com/django/django/pull/185
Change History (4)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 12 years ago
Thanks Aymeric - should I mark the pull request closed on GitHub, so it doesn't cause pollution?
Yes, it's worth highlighting why the order of INSTALLED_APPS matters.
Other resolution mechanisms depend on the order of INSTALLED_APPS (static assets collection for example) and I don't feel like listing them in the default settings.py.
The pull request also contains a stray commit. I'll just take the patch to the template docs and commit it.