There is a stack trace below the error. It should provide a lot of
information on where the error happened in your code

On 23 Dec 2016 4:42 p.m., "jon" <[email protected]> wrote:

> I am a newbie to Django, coming from PHP/Yii. I have gotten to the part 4
> of the official Django tutorial but can't seem to get by this error.
>
> I have looked online and in this forum but cannot find anything on this
> specific error.
>
> Error:
>
> AttributeError at /polls/1/vote/
>
> 'RegexURLResolver' object has no attribute 'default_args'
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/polls/1/vote/
> Django Version: 1.8.4
> Exception Type: AttributeError
> Exception Value:
>
> 'RegexURLResolver' object has no attribute 'default_args'
>
>
>
> View:
>
> def vote(request, question_id):
>     question = get_object_or_404(Question, pk=question_id)
>     try:
>         selected_choice = question.choice_set.get(pk=request.POST['choice'])
>     except (KeyError, Choice.DoesNotExist):
>         return render(request, 'polls/detail.html', {
>             'question': question,
>             'error_message': "You didn't select a choice.",
>         })
>     else:
>         selected_choice.votes += 1
>         selected_choice.save()
>         return HttpResponseRedirect(reverse('polls:results', 
> args=(question.id,)))
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/eaf2b01a-9a29-4b1e-867a-382291af54cd%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/eaf2b01a-9a29-4b1e-867a-382291af54cd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTaoFaFHW5RDWzz-a8Njj%3DHec_%2BeV7rwu3SiY2Y%3D-Vi-Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to