Opened 6 years ago

Closed 6 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


This appears to be a bug:


    url(r'^$', PermitListView.as_view(), name='permits'),
    url(r'^(?P<pk>\d+)/$', PermitView.as_view(), name='permit'),


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:

If I change the PermitView to this:

class PermitView(DetailView):
    model = Permit

Django looks for 'permits/permit_detail.html' as it should.

Change History (1)

comment:1 Changed 6 years ago by Aaron C. de Bruyn

Resolution: worksforme
Status: newclosed

Disregard, I started a new project and am unable to duplicate the issue in the new project.

Note: See TracTickets for help on using tickets.
Back to Top