[Fixed]-Reverse for '' with arguments '()' and keyword arguments not found. Django

0đź‘Ť

âś…

From your question, it seems you have more than one url that points to that view. So, remove the duplicate url. If that’s not the issue then make sure you are passing the “object id” correctly through the url. The “object id” (?P<pk>\d+) is a required parameter in the url to DetailView.

1đź‘Ť

You need to match the pk you’re passing in your regex:

url(r'^(?P<pk>\w+)/$', views.page_detail, name='page_detail'),
#             ^^^

\w+ is a character set that matches alphanumeric characters and the underscore, which will match 'print' in the current context.

Leave a comment