I have seen a few other questions about this on SO but they didn't solve my problem. I am running Django 1.8.5, Python 2.7.6.
I updated the root urls.py to
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^polls/', include('polls.urls', namespace="polls")),
url(r'^admin/', include(admin.site.urls)),
]
and polls/templates/polls/index.html to
{% if latest_question_list%}
<ul>
{% for question in latest_question_list %}
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No polls are available.</p>
{% endif %}
I get the error
NoReverseMatch at /polls/
u'polls' is not a registered namespace.
I have tried restarting the development server as the other answers I have suggested, as well as including {% load url from future %} in the template code; neither has worked. Not sure what I am missing, my code matches the files in the tutorial.
Edit: polls/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^(?P<question_id>[0-9]+)/$', views.detail, name='detail'),
url(r'^(?P<question_id>[0-9]+)/results/$', views.results, name='results'),
url(r'^(?P<question_id>[0-9]+)/vote/$', views.vote, name='vote'),]