#25061: Default template loader wrong in docs OR default loader not working
properly
---------------------------------+-----------------------------------------
     Reporter:  mlissner         |      Owner:  nobody
         Type:  Bug              |     Status:  new
    Component:  Template system  |    Version:  1.8
     Severity:  Normal           |   Keywords:  loader, templates, defaults
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  1                |      UI/UX:  0
---------------------------------+-----------------------------------------
 Not sure if the docs are correct or if the functionality is incorrect. In
 any case, the docs say that in Django 1.8, the default template loaders
 are:

 ('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.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.8e48cc7a539902faf8d8241fca8dfe8c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to