1👍
✅
You can only access the pk
if you have defined it in your urls.py like this:
url(r'^sss/edit/(?P<pk>\d+)$', PostUpdateView.as_view())
Source:stackexchange.com