1👍
Did you define the ‘polls’ namespace correctly in your root url’s like this?
urlpatterns = [
url(r'^polls/', include('polls.urls', namespace="polls")),
url(r'^admin/', include(admin.site.urls)),
]
change this line
return HttpResponseRedirect(reverse('polls:results', args=(p.id,)))
to
return HttpResponseRedirect(reverse('polls:results', kwargs={'pk':p.id}))
0👍
Have you tried to use named arguments for your links, like :
{% url 'polls:vote' question_id=question.id %}
or in the view :
return HttpResponseRedirect(reverse('polls:results', kwargs={'pk': p.pk}))
Source:stackexchange.com