from django.conf.urls import url from . import views
urlpatterns = [ # Home page. url(r'^$', views.index, name='index'), # Show all topics. url(r'^topics/$', views.topics, name='topics'), # Detail page for a single topic. url(r'^topics/(?P<topic_id>\d+)/$', views.topic, name='topic'), ]
Using the URLconf defined in learning_log.urls, Django tried these URL patterns, in this order: 1. admin/ 2. [name='index'] 3. topics [name='topics'] 4. topics/?P<topic_id>\d+/ [name='topic'] The current path, topics/1/, didn't match any of these.