Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Final Details url Tag

Reverse for 'list' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Help! I've restarted this whole class twice now because I couldn't get past this - whenever I add a namespace, I immediately receive the error in the subject. Prior to that, all pages and links worked.

The error references the {% url 'courses:list' %} part from layout.html, but that seems fine?


from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from . import views

urlpatterns = [
    # Examples:
    # url(r'^$', 'learning_site.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
urlpatterns += staticfiles_urlpatterns()

app urls.py

from django.conf.urls import url
from courses import views

urlpatterns = [


<!DOCTYPE html>
{% load static from staticfiles %}
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{% block title %}{% endblock title %}</title>
    <link rel="stylesheet" href="{% static 'css/layout.css' %}">
    <div class="site-container">
            <a href="{% url 'home' %}">Home</a>
            <a href="{% url 'courses:list' %}">Course List</a>

    {% block content %}

    {% endblock content %}


{% extends "layout.html" %}

{% block title %}Available Courses{% endblock title %}

{% block content %}
    <div class="cards">
    {% for course in courses %}
        <div class="card">
            <header><a href="{% url 'courses:detail' pk=course.pk %}">{{course.title}}</a></header>
            <div class="card-copy">
        {% endfor %}

{% endblock content %}

1 Answer

Hi Blaine

You have named the url that lists all the courses in the app.urls as 'courses' , shouldn't this be called 'list'?

urlpatterns = [
    #error is here i think
    # try this

let me know if this works

omg. That's a little embarrassing.. Thanks Andreas!

Dont worry, i have made so many errors like this

Thanks, you save my life :)