Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8313525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:31:06+00:00 2026-06-08T20:31:06+00:00

I am following the Django tutorial and have made it to Decoupling the URLConfs

  • 0

I am following the Django tutorial and have made it to Decoupling the URLConfs in tutorial 3. Prior to this step, everything was working. Now, when I do the final step of Removing hardcoded URLs in templates which is changing

<li><a href="/polls/{{ poll.id }}/">{{ poll.question }}</a></li>

to

<li><a href="{% url 'polls.views.detail' poll.id %}">{{ poll.question }}</a></li>

I get this error:

NoReverseMatch at /polls/

Reverse for ''polls.views.detail'' with arguments '(1,)' and keyword arguments '{}' not found.

Request Method:     GET
Request URL:    http://localhost:8000/polls/
Django Version:     1.4
Exception Type:     NoReverseMatch
Exception Value:    

Reverse for ''polls.views.detail'' with arguments '(1,)' and keyword arguments '{}' not found.

Exception Location:     e:\Django\development\tools\PortablePython\PortablePython2.7.3.1\App\lib\site-packages\django\template\defaulttags.py in render, line 424
Python Executable:  e:\Django\development\tools\PortablePython\PortablePython2.7.3.1\App\python.exe

My views.py looks like this:

from django.shortcuts import render_to_response, get_object_or_404
from polls.models import Poll

def index(request):
    latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
    return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list})

def detail(request, poll_id):
    p = get_object_or_404(Poll, pk=poll_id)
    return render_to_response('polls/detail.html', {'poll': p})

def results(request, poll_id):
    return HttpResponse("You're looking at the results of poll %s." % poll_id)

def vote(request, poll_id):
    return HttpResponse("You're voting on poll %s." % poll_id)

My project urls.py looks like this:

from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^polls/', include('polls.urls')),
    url(r'^admin/', include(admin.site.urls)),
)

And polls/urls.py looks like this:

from django.conf.urls import patterns, include, url

urlpatterns = patterns('polls.views',
    url(r'^$', 'index'),
    url(r'^(?P<poll_id>\d+)/$', 'detail'),
    url(r'^(?P<poll_id>\d+)/results/$', 'results'),
    url(r'^(?P<poll_id>\d+)/vote/$', 'vote'),
)

Obviously I missed something, but I have been over part 3 a few times now and can’t figure out what I missed. What do I need to correct to correctly decouple these URLs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:31:07+00:00Added an answer on June 8, 2026 at 8:31 pm

    This is a version issue. You’ve somehow found a link for the development version of Django, while you’re using release 1.4. One of the things that’s changed since the release is that URL names in templates used not to need quotes, but now they do. That’s why the error message has the URL name within two sets of quotes.

    You should use this version of the tutorial to match the Django version you have. (You could install the development version, but that’s not recommended – stick to the release.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the Django-CMS introductory tutorial and have got everything working up to the
I am following the django tutorial here . I have copied everything exactly. After
I am following this part of the 'django by example' tutorial. Now when I
I'm just learning django and following a tutorial. I have a Link and a
Following the Heroku tutorial but I have already created a rather complex Django app
I created a form by following django tutorial on modelfomrs . This is the
I am following along with this Django blog tutorial and can not get the
After following the tutorial for Django, I have the baseline of my app up
I am new to Django & Python and have been following a tutorial, but
I have tried this tutorial http://adrian.org.ar/python/django-nginx-green-unicorn-in-an-ubuntu-11-10-ec2-instance to setup django with ngnix and gunicorn.I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.