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 Model Administration First App View

Django: First App: Why do I continue to get "hello world"?

I am not understanding why I continue to see "Hello World" as a result after following through with all the steps. As I am not getting an error message its difficult to isolate my problem area.

Can anyone isolate where I am wrong in my code?

https://w.trhou.se/iis6c7wlxa

1 Answer

Alex Koumparos
seal-mask
.a{fill-rule:evenodd;}techdegree
Alex Koumparos
Python Development Techdegree Student 36,887 Points

Hi cb123,

I think you are looking at the root url of your project, which still loads the hello world view. If you add /courses in the url bar it loads your course_list view.

This is because when you load your site it is going to the root url (the path represented by the regex ^$) which is a match for the urls.py in the learning_site directory.

To get the courses_list view you need to go to the url /courses/. This is because the urls.py file in your courses directory only gets loaded when the url matches /courses (this is the effect of line 21 in your root urls.py). Once the first part of the url matches /courses, then your other urls.py file gets loaded and checks whether the rest of hte url is empty.

Hope that makes sense.

Cheers

Alex

I do not know how I did not notice him adding /courses/ to the URL. That is definitely the answer. Thanks.