#27819: Display a warning when django.views.generic.ListView assumes the default
template name
-------------------------------------+-------------------------------------
Reporter: Maker Bajax | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Generic views | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Maker Bajax):
Replying to [comment:1 Tim Graham]:
> I can't think of a similar precedent elsewhere in Django for a warning
or logging like that. The debug page usually display a list of template
names it tried to load for a `TemplateDoesNotExist` exception. Was that
not the case here?
Yes, but it wasn't helpful. It only showed the different file paths where
it tried to locate the template, but it didn't show where the template
itself was defined.
It'd be ideal if there was some way to add an extra blurb to the exception
message when it actually doesn't find a template with the default name,
but honestly I have no idea how to get the message from the point where it
configures the ListView object to the point where the TemplateNotFound
exception would be thrown. (leave template_name None during config, and
look for the default name right before the template is loaded, maybe?) I
thought it at least worth discussing because of the aforementioned
ImproperlyConfigured exceptions for the exact mistake I made being caught
and discarded.
--
Ticket URL: <https://code.djangoproject.com/ticket/27819#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 [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/063.d7fdb5186f4d7597cc8f0ea54b4edcd7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.