Opened 12 years ago

Closed 12 years ago

Last modified 12 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

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 Aymeric Augustin, 12 years ago

Triage Stage: UnreviewedAccepted

Yes, it's worth highlighting who 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.

Version 0, edited 12 years ago by Aymeric Augustin (next)

comment:2 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

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 by Daniele Procida, 12 years ago

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

comment:4 by Aymeric Augustin, 12 years ago

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

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