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! While you're at it, check out some resources Treehouse students have shared here.
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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Konrad Hunter](https://secure.gravatar.com/avatar/53e04baaa7c5313660bfd432298101f8?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Konrad Hunter
3,629 PointsNoReverseMatch at /courses/1/2/
I get this error when I add the line. <a href="{% url 'courses.views.course_list' %}">Courses</a>
It runs fine with only line. <a href="{% url 'views.hello_world' %}">Home</a>
It looks like workspaces is running django version 1.9.9.
I know others have had this question, but haven't found a working solution from other answers. I appreciate the help.
1 Answer
![Ryan S](https://uploads.teamtreehouse.com/production/profile-photos/5965142/micro_Ryan2.jpg)
Ryan S
27,276 PointsHi Konrad,
This was a tricky one to debug, and I learned something about Django in the process. The main issue is that once you assign a name or a namespace to a url pattern, Django is going to be looking for that particular "namespace:name" when it tries to match patterns. You won't be able to call the view by chaining together it's location, (eg. "courses.views.course_list"). I didn't know that Django enforced this.
In your learning_site/urls.py, you have actually copied and pasted the same code twice. The second instance of "urlpatterns" overrides the first, and in the second you have defined the courses' namespace as "courses".
In courses/urls.py, you have named the call to the "course_list" view as "list".
So in layout.html when you are adding the anchor tag, you need to refer to the view by its 'namespace:name'.
Eg.
<a href="{% url 'courses:list' %}">Courses</a>
As of your current workspace, it looks like you forgot to include the namespace.
If you want to try it with your original "href" attribute that you mentioned in your question, you will need to delete the namespace and name in both learning_site/urls.py, and courses/urls.py.
In the video, after Kenneth assigns the names and namespace to the url patterns, he changes the hrefs accordingly.
Hope this helps.
![Konrad Hunter](https://secure.gravatar.com/avatar/53e04baaa7c5313660bfd432298101f8?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Konrad Hunter
3,629 PointsThanks, Ryan. It worked as you said.
Konrad Hunter
3,629 PointsKonrad Hunter
3,629 Pointshere is the snapshot link. http://w.trhou.se/287nfyzfod