﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30919	Template-loader postmortem should list non-existent directories.	instantname	nobody	"With debug on, when a template is not found, the ""template-loader postmortem"" shown in the TemplateDoesNotExist error page seems to only list search directories that exist on the filesystem (see example below). In my opinion, it would make more sense to display all the directories searched, even if they do not exist. Reasons are:

  - It is easier to figure out how changing the templates settings changes what paths searched.

  - Hiding non-existing searched directories makes misconfigurations more likely as developers may not be aware of all the paths that are searched.

I have tested on the example below. Maybe this also happens in other cases.

settings.py:
{{{
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS: [],
        'APP_DIRS': True,
        ...
    }
]
INSTALLED_APPS = [
    'my_app',
    ...
]
}}}

If the directory /.../my_project/my_app/templates exists and is empty, requesting the non-existent 'my_app/index.html' template gives this debug log:
{{{
Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

    django.template.loaders.app_directories.Loader: /var/local/my_project/my_app/templates/my_app/index.html (Source does not exist)
    [... other things ...]
}}}

But if the directory /.../my_project/my_app/templates does not exist, that search path disappears from the list of searched paths in the TemplateDoesNotExist traceback:
{{{
Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:

    [... only the other things ...]
}}}
"	New feature	closed	Template system	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
