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
Need help with urlpatterns for Django 2.0 and greater
Can't seem to get the urlpattern to work, fo Django 2.0.
Following the example from the documentation, and it should work... https://docs.djangoproject.com/en/2.0/topics/http/urls/
from django.urls import path from . import views urlpatterns = [ path('', views.course_list), path('<int:course_pk>/<int:step_pk>/', views.step_detail), path('<int:pk>/', views.course_detail), ]
Henrik ChristensenPython Web Development Techdegree Student 38,322 Points
What problem(s) do you experience?
Ian SalmonCourses Plus Student 10,686 Points
shaddowa This is what worked for me. The same as OP. I believe that his issue was with either the urlConf or views.py. Send me a message if you're still stuck!
path('', views.course_list), path('<int:course_pk>/<int:step_pk>/', views.step_detail), path('<int:pk>/', views.course_detail),