17 lines
383 B
Python
17 lines
383 B
Python
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("brands", BrandViewset)
|
|
router.register("products", ProductViewset)
|
|
router.register("posts", PostViewset)
|
|
|
|
urlpatterns = router.urls
|