1👍
✅
You need to name your urls:
urlpatterns = [
url(r'^widgets/$', views.WidgetList.as_view(), name="widget-list"),
url(r'^widgets/(?P<pk>[0-9]+)/$', views.WidgetDetail.as_view(), name="widget-detail"),
]
Source:stackexchange.com