[Django]-Why is the first "hello world" example in the django book not working?

4đź‘Ť

âś…

The reason for 404 is that there is no matching regex for http://127.0.0.1:8000/ page in your urlpatterns:

urlpatterns = patterns('',
                       url('^hello/$', hello)
                       )

^hello/$ regex matches only http://127.0.0.1:8000/hello/ url.

👤alecxe

3đź‘Ť

You’re defining a URL for /hello but you aren’t actually going to that URL, you’re going to /. You need to actually use the “hello” in your browser’s address bar.

Leave a comment