[Answer]-Django: DetailView – pk or a slug

1👍

You don’t use class-based views like this. They are classes. You should get rid of your foo function altogether and just reference TestDetailView from the urls.py. If you need to do some extra custom logic in your view which is currently in foo, then subclass TestDetailView and do it there.

Leave a comment