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

Python Django Basics Final Details url Tag

Daniel Still
Daniel Still
10,532 Points

Reverse for 'views.hello_world' not found.

I've spent all afternoon on this and can't seem to get past it. Has there been a recent update in Django for the url tag function or something? I've written exactly what is written in the videos and yet the same error keeps returning.

The error says this: NoReverseMatch at / Reverse for 'views.hello_world' not found. 'views.hello_world' is not a valid view function or pattern name.

The line which is identified as the problem is this line of code...

  1. <a href="{% url 'views.hello_world' %}">Home</a>

Basically, it can't find my hello_world() view, even though it exists in the views.py file and is referenced in the urls.py file.

I can assure you that I have written exactly what is written in each video but am happy to post my code if necessary. Any help would be massively appreciated!

2 Answers

Tatiana Vasilevskaya
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tatiana Vasilevskaya
Python Web Development Techdegree Graduate 28,600 Points

I believe you're using a more recent version of Django than Kenneth used in the video. There is a note about this in the Teacher's Notes as well as numerous Questions on the Topic in the Questions section under the video. Here is one of the answers https://teamtreehouse.com/community/is-there-anything-like-this-in-django-110-or-is-there-another-syntax-for-it-thanks-in-advance.

Daniel Still
Daniel Still
10,532 Points

I thought so. I just installed Django today so that makes sense. Thanks heaps.