Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango error NoReverseMatch while i rendering
    primarykey
    data
    text
    <p>I'm creating my first django app using this tutorial <a href="https://docs.djangoproject.com/en/dev/intro/tutorial04/" rel="nofollow">https://docs.djangoproject.com/en/dev/intro/tutorial04/</a> .I'm up to the final task and now I have this error which I don't know how to fix.I'm going to show you my whole program and I'll try to pin point at where I think I went wrong in making this poll.This app is like Poll. It display a poll and some choice and you must vote on it.</p> <p>This is my error</p> <pre><code>TemplateSyntaxError at /polls/1/ Caught NoReverseMatch while rendering: u'myapp' is not a registered namespaceRequest Method: GET Request URL: http://cat.pythonanywhere.com/polls/1/ Django Version: 1.3.5 Exception Type: TemplateSyntaxError Exception Value: Caught NoReverseMatch while rendering: u'myapp' is not a registered namespace Exception Location: /usr/local/lib/python2.7/site-packages/django/template/defaulttags.py in render, line 450 Python Executable: /usr/local/bin/uwsgi Template error In template /home/cat/mysite/myapp/templates/myapp/detail.html, error at line 5 Caught NoReverseMatch while rendering: u'myapp' is not a registered namespace 1 &lt;h1&gt;{{ poll.question }}&lt;/h1&gt; 2 3 {% if error_message %}&lt;p&gt;&lt;strong&gt;{{ error_message }}&lt;/strong&gt;&lt;/p&gt;{% endif %} 4 5 &lt;form action="{% url myapp:vote poll.id %}" method="post"&gt; 6 {% csrf_token %} 7 {% for choice in poll.choice_set.all %} 8 &lt;input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" /&gt; 9 &lt;label for="choice{{ forloop.counter }}"&gt;{{ choice.choice_text }}&lt;/label&gt;&lt;br /&gt; 10 {% endfor %} 11 &lt;input type="submit" value="Vote" /&gt; 12 &lt;/form&gt; </code></pre> <p>I think the error is hiding in my detail.html</p> <pre><code>&lt;h1&gt;{{ poll.question }}&lt;/h1&gt; {% if error_message %}&lt;p&gt;&lt;strong&gt;{{ error_message }}&lt;/strong&gt;&lt;/p&gt;{% endif %} &lt;form action="{% url myapp:vote poll.id %}" method="post"&gt; {% csrf_token %} {% for choice in poll.choice_set.all %} &lt;input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" /&gt; &lt;label for="choice{{ forloop.counter }}"&gt;{{ choice.choice_text }}&lt;/label&gt;&lt;br /&gt; {% endfor %} &lt;input type="submit" value="Vote" /&gt; &lt;/form&gt; </code></pre> <p>My Urls.py </p> <pre><code>from django.conf.urls.defaults import * from mysite.myapp import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^(?P&lt;poll_id&gt;\d+)/$', views.detail, name='detail'), url(r'^(?P&lt;poll_id&gt;\d+)/results/$', views.results, name='results'), url(r'^(?P&lt;poll_id&gt;\d+)/vote/$', views.vote, name='vote'), ) </code></pre> <p>I hope someone can help me because I have no idea how to fix this error</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload