1
pk
means primary key. So there you’re trying to get a poll object whose id is same to the post_pk.
Try,
p = get_object_or_404(Poll, post_id=post_pk)
Source:stackexchange.com
1
pk
means primary key. So there you’re trying to get a poll object whose id is same to the post_pk.
Try,
p = get_object_or_404(Poll, post_id=post_pk)