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!
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
is this challenge broken? https://teamtreehouse.com/library/django-basics/what-a-view/first-url
So I was just trying to wrap up some of the quizzes I skipped over. Either I'm totally not tracking today, or this challenge is broken?
from django.conf.urls import url from . import views urlpatterns = [ path('', index) ]
I haven't been through any Django stuff, and I kind of suck at regex. So unfortunately I won't be able to go into too much detail about why this is true, or any more advanced expressions, but...
My understanding is that
path('', index) isn't strictly defining an empty string. I think you need
r'^$' to ensure you're matching an entirely empty string. When Django encounters an empty string, I believe it will go to the
Trying that along with making sure to reference
views.index fixed it for me. Sorry I can't more clearly explain why this works, but maybe it will trigger your memory. 😅