from django.conf import settings from rest_framework import routers from .viewsets import UserViewset if settings.DEBUG: router = routers.DefaultRouter() else: router = routers.SimpleRouter() router.register("", UserViewset) urlpatterns = router.urls