while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

33 views
Skip to first unread message

Avitab Ayan Sarmah

unread,
May 7, 2018, 5:14:25 PM5/7/18
to Django users
Detail.html:

<h1>{{ question.question_text }}</h1>

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

<form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
{% for choice in question.choice_set.all %}
  <input type="radio" name="choice" id="choice{{ forloop.counter }}"
value="{{ choice.id }}" />
  <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}
</label><br />
{% endfor %}
<input type="submit" value="vote" />
</form>

browser error.PNG
Capture6.PNG
Capture7.PNG

Dylan Reinhold

unread,
May 7, 2018, 5:24:16 PM5/7/18
to django...@googlegroups.com
Share your polls/url.py it's saying it cant find the url named "vote" in your polls.

Dylan

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/aab94309-a65f-49ec-bd4d-bb07bf5457a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Avitab Ayan Sarmah

unread,
May 7, 2018, 5:25:51 PM5/7/18
to Django users
polls/urls.py:

from django.urls import path

from . import views

app_name = 'polls'
urlpatterns = [
# ex: /polls/
path('', views.index, name='index'),
# ex: /polls/5/
path('<int:question_id>/', views.detail, name='detail'),
#ex: /polls/5/results/
path('<int:question_id>/results/', views.results, name='results'),
#ex: /polls/5/vote/
path('int:question_id>/vote/', views.vote, name='vote'),
]


On Monday, May 7, 2018 at 10:54:16 PM UTC+5:30, Dylan Reinhold wrote:
Share your polls/url.py it's saying it cant find the url named "vote" in your polls.

Dylan
On Mon, May 7, 2018 at 10:14 AM, Avitab Ayan Sarmah <avita...@gmail.com> wrote:
Detail.html:

<h1>{{ question.question_text }}</h1>

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

<form action="{% url 'polls:vote' question.id %}" method="post">
{% csrf_token %}
{% for choice in question.choice_set.all %}
  <input type="radio" name="choice" id="choice{{ forloop.counter }}"
value="{{ choice.id }}" />
  <label for="choice{{ forloop.counter }}">{{ choice.choice_text }}
</label><br />
{% endfor %}
<input type="submit" value="vote" />
</form>

--
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 django-users...@googlegroups.com.

Avitab Ayan Sarmah

unread,
May 7, 2018, 5:33:59 PM5/7/18
to Django users
i got the error thank you. It was a simple error i forgot to put "<" before vote

Jani Tiainen

unread,
May 7, 2018, 6:38:23 PM5/7/18
to django...@googlegroups.com
Also next time please post exceptions as a text. Images are really hard to read specially on mobile device.

Avitab Ayan Sarmah

unread,
May 8, 2018, 10:55:33 AM5/8/18
to django...@googlegroups.com
Sure

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/bSlQt0K3Pe8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages