from django.conf.urls import include from django.urls import re_path from rest_framework import routers from grids import views as grids_views router = routers.DefaultRouter() router.register(r"levels", grids_views.LevelViewSet, basename="level") router.register(r"grids", grids_views.GridViewSet, basename="grid") router.register(r"words", grids_views.WordViewSet, basename="word") router.register(r"placement", grids_views.PlacementViewSet, basename="placement") v1_pattern = router.urls urlpatterns = [re_path(r"^v1/", include((v1_pattern, "v1"), namespace="v1"))]