cookiecutter-django/{{cookiecutter.project_slug}}/config/api_router.py
2024-02-13 11:59:55 +01:00

14 lines
351 B
Python

from django.conf import settings
from rest_framework.routers import DefaultRouter
from rest_framework.routers import SimpleRouter
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
router = DefaultRouter() if settings.DEBUG else SimpleRouter()
router.register("users", UserViewSet)
app_name = "api"
urlpatterns = router.urls