cookiecutter-django/{{cookiecutter.project_slug}}/config/api_router.py

16 lines
336 B
Python
Raw Normal View History

2019-09-13 09:43:12 +03:00
from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter
2019-09-13 09:43:12 +03:00
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
if settings.DEBUG:
router = DefaultRouter()
else:
router = SimpleRouter()
2020-01-23 18:04:30 +03:00
router.register("users", UserViewSet)
2019-09-13 09:43:12 +03:00
2020-01-23 18:04:30 +03:00
app_name = "api"
2019-09-13 09:43:12 +03:00
urlpatterns = router.urls