﻿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
27819	Display a warning when django.views.generic.ListView assumes the default template name	Maker Bajax	nobody	"I recently had an issue where it seemed that my code was trying to load a template for a ListView that I had defined previously, but renamed.  Even though there was no more reference to the old template in another part of my code, it still gave me ""Template not found.""   I spent a couple of hours scouring my code for references, deleting .pyc files and checking if the template had gotten cached in the database or something (It was a Django CMS project).

Lo and behold, after finally taking the time to set up a debugger and step through,  I found the rogue template name was being derived from the app and model name as is done here (this is not the same version I'm using, but the line in question is identical):

https://github.com/django/django/blob/ff8711a825ea9bbe98e873d7aa28ce5135528fec/django/views/generic/list.py#L137

So with respect to that  error message--  It was ""Template not found.""  To the me at that time, that didn't mean, ""You didn't define a template, so I assumed one for you,"" but ""You handed me a bad template name."" 

I wasn't even aware that the ListView object could accept a template name (I'm still learning Django TBH) and I thought that was up to some other layer of the system to handle.  At the time I had no idea where the template name could be coming from.

It would be nice if we could get a warning of some kind when a default is assumed like this.  I know it's a design goal of Django to assume things that are left undefined, but maybe some warnings, especially at high verbosity, would be helpful.  I even saw some places in the code where an ""ImproperlyConfigured"" exception was raised because I hadn't set a template name, but it was caught by some later code and everything carried on as if nothing was wrong."	Cleanup/optimization	closed	Generic views	1.8	Normal	wontfix		Nan Xiang	Accepted	0	0	0	0	0	0
