Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Django Basics Final Details url Tag

No reverse match at /

I was following the video till i got into this error that i don't know how to fix. The error says Reverse for 'views.HelloWorld' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [].

Any suggestions ?

Steven Parker
Steven Parker
222,349 Points

To make an analysis possible, show your (properly formatted) code. Or better yet, make a snapshot of your workspace and post the link to it here.

3 Answers

João Elvas
João Elvas
5,400 Points

Hello m8,

The video is old and you are probably working with django 1.10

For this to work you have to name all of your URLs as:

url(r'^$', views.hello_world, name='hello')

And then in the layout.html you just use the name:

<a href="{% url 'hello' %}">Home</a>

Good Luck

Thank you so much man!

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,239 Points

It would help to see the urls.py and views files Please check the following:

:point_right: Do you have a urls.py file with a URL defined for the view views.HelloWorld and the spelling and case match.

:point_right: Does the URL in the urls.py file have a name argument with a different value than "HelloWorld"?

:point_right: In the template, is the view name in quotes?