Reverse for 'vote' with arguments '('',)' not found. 1 pattern(s) tried: ['polls/(?P<question_id>[0-9]+)/vote/$']
Request Method: | GET |
---|---|
Request URL: | http://127.0.0.1:8000/polls/1/ |
Django Version: | 3.0.3 |
Exception Type: | NoReverseMatch |
Exception Value: | Reverse for 'vote' with arguments '('',)' not found. 1 pattern(s) tried: ['polls/(?P<question_id>[0-9]+)/vote/$'] |
Exception Location: | C:\Users\Andhika\AppData\Local\Programs\Python\Python38\lib\site-packages\django\urls\resolvers.py in _reverse_with_prefix, line 677 |
Python Executable: | C:\Users\Andhika\AppData\Local\Programs\Python\Python38\python.exe |
Python Version: | 3.8.1 |
Python Path: | ['E:\\TestingKetiga-2\\mysite', 'C:\\Users\\Andhika\\AppData\\Local\\Programs\\Python\\Python38\\python38.zip', 'C:\\Users\\Andhika\\AppData\\Local\\Programs\\Python\\Python38\\DLLs', 'C:\\Users\\Andhika\\AppData\\Local\\Programs\\Python\\Python38\\lib', 'C:\\Users\\Andhika\\AppData\\Local\\Programs\\Python\\Python38', 'C:\\Users\\Andhika\\AppData\\Roaming\\Python\\Python38\\site-packages', 'C:\\Users\\Andhika\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages'] |
Server time: | Wed, 19 Feb 2020 09:56:21 +0000 |
In template E:\TestingKetiga-2\mysite\polls\templates\polls\detail.html
, error at line 5
1 | <h1>{{ question.question_text }}</h1> |
---|---|
2 | |
3 | {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} |
4 | |
5 | <form action="{% url 'polls:vote' question.id %}" method="post"> |
6 | {% csrf_token %} |
7 | {% for choice in question.choice_set.all %} |
8 | <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}"> |
9 | <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br> |
10 | {% endfor %} |
11 | <input type="submit" value="Vote"> |
12 | </form> |