Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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


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 of the project template, and a note in the docs, in a pull request at

Change History (4)

comment:1 Changed 7 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

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

The pull request also contains a stray commit. I'll just take the patch to the template docs and commit it.

Last edited 7 years ago by Aymeric Augustin (previous) (diff)

comment:2 Changed 7 years ago by Aymeric Augustin <aymeric.augustin@…>

Resolution: fixed
Status: newclosed

In [8c670ee34714acffbc64e5cafd1e664fb8341a37]:

Fixed #18617 -- Highlighted that the app_directories template loader depends on the order of INSTALLED_APPS.

Thanks evildmp for the patch.

comment:3 Changed 7 years ago by Daniele Procida

Thanks Aymeric - should I mark the pull request closed on GitHub, so it doesn't cause pollution?

comment:4 Changed 7 years ago by Aymeric Augustin

Yes, I've just closed it (I forgot when I committed the patch).

Note: See TracTickets for help on using tickets.
Back to Top