Generic detail view DetailView must be called with either an object pk or a slug in the URLconf.

The specific error message is telling you what the issue is.

Note how the URLs are defined in the tutorial at Writing your first Django app, part 4 | Django documentation | Django

Your definition of the url is:

You have changed the name of the url parameter without making the other changes necessary to make this work.

(Also see Single object mixins | Django documentation | Django)

1 Like