#21948: Docs on extending admin templates should mention TEMPLATE_LOADERS
--------------------------------------+------------------------------------
     Reporter:  django@…              |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  1.6
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  1                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by timo):

 * type:  Uncategorized => Cleanup/optimization
 * easy:  0 => 1
 * stage:  Unreviewed => Accepted


Old description:

> The docs at https://docs.djangoproject.com/en/dev/ref/contrib/admin
> /#overriding-admin-templates should mention that you *must* set:
>
> {{{
> TEMPLATE_LOADERS = (
>      'django.template.loaders.filesystem.Loader',
>      ...
> )
> }}}
>
>  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 settings.py
> created with `django-admin.py 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)
>
> Thanks

New description:

 The docs at https://docs.djangoproject.com/en/dev/ref/contrib/admin
 /#overriding-admin-templates should mention that you *must* set:

 {{{
 TEMPLATE_LOADERS = (
      'django.template.loaders.filesystem.Loader',
      ...
 )
 }}}

 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 settings.py
 created with `django-admin.py 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)

 Thanks

--

Comment:

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

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21948#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.1e75c8eabde40287ac2a1df6f4cafec5%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to