I have created a pk field(not automatically created by the model). when I want to use this pk name(in my case school_id) I got this error:
Generic detail vie
Add pk_url_kwarg = 'school_pk' to view SchoolDetailView. By default it is set to pk.
pk_url_kwarg = 'school_pk'
SchoolDetailView
pk
class SchoolDetailView(DetailView): context_object_name = 'school' model = models.School template_name = 'basic_app/school_detail.html' pk_url_kwarg = 'school_pk'