from django.urls import include,path from customers import views # import routers from the REST framework # it is necessary for routing from rest_framework import routers # create a router object router = routers.DefaultRouter() # register the router router.register(r'customers',views.CustomerView, 'customers') urlpatterns = [ path("", views.index), path("customers/", include("customers.urls")), path("admin/", admin.site.urls), path('api/', include(router.urls)) ]