Hi, Look at this:
https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse `viewname` is incorrect in your app you must use 'poll_results' instead of 'polls.views.results' Krzysztof Hoffmann On 9 Cze, 09:28, bahare hoseini <bhhose...@gmail.com> wrote: > hi there, > this is my views.py that doesn't have any problem: > > from django.shortcuts import get_object_or_404, render_to_response > from django.core.urlresolvers import reverse > . > . > . > return HttpResponseRedirect(reverse('polls.views.results', args=( > p.id,))) > > def results(request, poll_id): > p = get_object_or_404(Poll, pk=poll_id) > return render_to_response('(...)/polls/results.html', {'poll': p}) > --------------------------------------------------------------------------- > ------------------------------------- > but when i edit my urls.py like this: > > #... > urlpatterns = patterns('', > (r'^$', > ListView.as_view( > queryset=Poll.objects.order_by('-pub_date')[:5], > context_object_name='latest_poll_list', > template_name='(...)polls/index.html')), > (r'^(?P<pk>\d+)/$', > DetailView.as_view( > model=Poll, > template_name='(...)polls/detail.html')), > url(r'^(?P<pk>\d+)/results/$', > DetailView.as_view( > model=Poll, > template_name='(...)polls/results.html'), > name='poll_results'), > (r'^(?P<poll_id>\d+)/vote/$', 'polls.views.vote'), > --------------------------------------------------------------------------- > --------------------------------------- > and open my browser with the link (http://localhost:8000/polls/id=1/vote), > I'd face this error: can anybody help please? > > Reverse for 'polls.views.results' with arguments '(id=1,)' and keyword > arguments '{}' not found. > > can anybody help? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.