class MyView(DetailView):
    template_name = 'detail.html'
model = MyModel
slug = None

def get_object(self, queryset=None):
    return queryset.get(slug=self.slug)
Django class-based view: How do I pass additional parameters to the as_view method?