urls.py 378 B

1234567891011121314
  1. from django.urls import include, path
  2. from rest_framework_nested import routers
  3. from .views import ProjectViewSet
  4. router = routers.SimpleRouter()
  5. router.register(r"projects", ProjectViewSet)
  6. projects_router = routers.NestedSimpleRouter(router, r"projects", lookup="project")
  7. urlpatterns = [
  8. path("", include(router.urls)),
  9. path("", include(projects_router.urls)),
  10. ]