[Fixed]-DRF – Reverse for 'widget-detail' with arguments '()' and keyword arguments '{u'pk': ''}' not found. 0 pattern(s) tried: []

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"),
]

Leave a comment