<filename>API/urls.py
# API/urls.py
from django.conf.urls import url
from django.urls import include, path
from rest_framework import routers
from . import views

router = routers.DefaultRouter()
router.register(r'clients', views.ClientViewSet)
router.register(r'fournisseurs', views.FournisseurViewSet)
router.register(r'produits', views.ProduitViewSet)
router.register(r'achats', views.AchatViewSet)
router.register(r'users', views.UserViewSet)
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    path('', include(router.urls)),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    #path('clients/<int:pk>/', views.ClientDetail.as_view())
    url(r'^prod/count/$', views.CountViewSet.as_view(), name='produits-count'),
    url(r'^risk/$', views.RiskViewSet.as_view(), name='risk'),
    ]
