('django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
The error I ran into was that when I had the TEMPLATES variable set,
Django could not find the templates from the debug toolbar, which made me
think that the app_directories loader wasn't working.
I did three tests:
First, I added the above tuple to the TEMPLATES directory to see if the
default wasn't being set correctly. When I added the values above,
suddenly the template was found successfully.
Second, I created a brand new project in a brand new virtualenv. In the
env I installed django_debug_toolbar and django 1.8.2. I then added
debug_toolbar to the installed apps, and tested if runserver could find
the templates it needed to. Sure enough, this worked.
Third, when that worked, I noticed that the default settings for Django
1.8.2 still use the TEMPLATE_ format. This seems odd (perhaps an indicator
that my system wasn't clean?) but I swapped the settings over to use the
TEMPLATES variable instead. Again, when 'loaders' is unset, the template
can't be found, but when it is set to the supposed default value, things
work fine.
--
Ticket URL: <https://code.djangoproject.com/ticket/25061>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Which docs are you referring to regarding the template loaders defaults?
Is it from the [https://docs.djangoproject.com/en/dev/ref/settings
/#template-loaders TEMPLATE_LOADERS] setting? If so, I think the confusion
is that once you define the `TEMPLATES` setting, the old `TEMPLATE_`
settings are ignored.
--
Ticket URL: <https://code.djangoproject.com/ticket/25061#comment:1>
* status: new => closed
* resolution: => invalid
Comment:
As best I can figure out, OP is either referring to what you linked, or to
the mention of "the default value of TEMPLATE_LOADERS" in
https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/#the-
templates-settings
Both of those are referring to the default value of `TEMPLATE_LOADERS`
pre-1.8. The default value of `['OPTIONS']['loaders']` for Django Template
Language in 1.8 is more complex; it only includes the `app_directories`
loader if you set `APP_DIRS: True`, as documented in the TEMPLATES setting
docs: https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-
TEMPLATES
I would assume the OP isn't setting `APP_DIRS: True`. It defaults to
`False`, though the startproject default settings file sets it to `True`.
But it sounds like OP also has a polluted installation of 1.8 which is
somehow still using an old project template. Django 1.8 startproject
template definitely uses `TEMPLATES`, not `TEMPLATE_*`.
--
Ticket URL: <https://code.djangoproject.com/ticket/25061#comment:2>
Comment (by mlissner):
Yeah, I think it's safe to close this off. I thought that the old
TEMPLATE_* settings were mapped more or less directly to the new OPTIONS
key...missed that it's {} by default.
End of day Friday. Apologies.
--
Ticket URL: <https://code.djangoproject.com/ticket/25061#comment:3>