Opened 2 years ago

Closed 2 years ago

#21948 closed Cleanup/optimization (fixed)

Docs on extending admin templates should mention TEMPLATE_LOADERS

Reported by: django@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by timo)

The docs at should mention that you *must* set:


and that django.template.loaders.filesystem.Loader must come before django.template.loaders.app_directories.Loader.

This confused me for a long time, mainly because the default created with startproject myproject doesn't contain any of those settings.

(P.S. you also need to set TEMPLATE_DIRS of course. This is mentioned in the docs linked above, but I think it could be clearer)


Change History (4)

comment:1 Changed 2 years ago by anonymous

  • Component changed from Uncategorized to Documentation
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 2 years ago by timo

  • Description modified (diff)
  • Easy pickings set
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

These are the default loaders so that's why it's probably not mentioned.

comment:3 Changed 2 years ago by alextreme

A small addition to clarify that the filesystem template loader must be used when extending the admin templates, in case the user has deviated from the default:

comment:4 Changed 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In ea869b514846cdd4803e3a87b08686113c14f7f2:

Fixed #21948 -- Noted TEMPLATE_LOADERS requirement when overriding admin templates.

Thanks django at for the suggestion.

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