1👍
✅
You can override the get_template_names
method, so:
class AlbumDetailView(DetailView):
model = Album
template_name = 'bilddatenbank/album_detail.html'
def get_template_names(self):
if self.object.type == 't': # special type
return ('bilddatenbank/other_template.html',)
return super().get_template_names()
Source:stackexchange.com