from django.conf import settings from rest_framework import routers from .viewsets import BrandViewset, PostViewset, ProductViewset if settings.DEBUG: router = routers.DefaultRouter() else: router = routers.SimpleRouter() router.register("brand", BrandViewset) router.register("product", ProductViewset) router.register("post", PostViewset) urlpatterns = router.urls