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.
- In django, values(*field) doesn't give all values of ForeignKey field with sliced queryset
- Django rest_social_auth log in. What to do with facebook token?
- How to create a User model object using Django REST framework?
Source:stackexchange.com