Django Error u“'polls” is not a registered namespace

后端 未结 13 2606
误落风尘
误落风尘 2021-01-31 07:41

Yesterday I was working on my first app using this tutorial. It\'s a Poll and Choice app. The first page displays the question and when you click on the question it\'s suppose t

13条回答
  •  情话喂你
    2021-01-31 08:26

     from django.conf.urls import patterns, include, url
     from django.contrib import admin
     from django.conf import settings
    
    
    
     urlpatterns = patterns('myapp.views',
         url(r'^$', 'index', name="index"),
         url(r'^(?P\d+)/$', 'detail', name="detail"),
         url(r'^(?P\d+)/results/$', 'results', name="results"),
         url(r'^(?P\d+)/vote/$', 'vote', name="vote"),
    )
    
    ----------------------------------    
    
     

    {{ poll.question }}

    {% if error_message %}

    {{ error_message }}

    {% endif %}
    {% csrf_token %} {% for choice in poll.choice_set.all %}
    {% endfor %}

提交回复
热议问题