Opened 13 years ago
Closed 13 years ago
#17484 closed Bug (worksforme)
DetailView crashes w/ TemplateDoesNotExist("No template names provided") where ListView doesn't
Reported by: | Aaron C. de Bruyn | Owned by: | nobody |
---|---|---|---|
Component: | Generic views | Version: | 1.4-alpha-1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This appears to be a bug:
From urls.py:
url(r'^$', PermitListView.as_view(), name='permits'), url(r'^(?P<pk>\d+)/$', PermitView.as_view(), name='permit'),
From views.py
class PermitListView(ListView): queryset = Permit.objects.all() class PermitView(DetailView): queryset = Permit.objects.all()
When accessing the page that triggers the ListView object, Django looks for 'permits/permits_list.html'.
When accessing the page that triggers the DetailView object, Django crashes outputting "A server error occurred. Please contact the administrator." to the browser and this traceback: http://dpaste.com/679783/
If I change the PermitView to this:
class PermitView(DetailView): model = Permit
Django looks for 'permits/permit_detail.html' as it should.
Note:
See TracTickets
for help on using tickets.
Disregard, I started a new project and am unable to duplicate the issue in the new project.