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

15 lines
335 B
Python
Raw Normal View History

2019-09-13 09:43:12 +03:00
from rest_framework.routers import DefaultRouter, SimpleRouter
from django.conf import settings
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