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

14 lines
351 B
Python
Raw Normal View History

2019-09-13 09:43:12 +03:00
from django.conf import settings
2024-02-13 13:57:53 +03:00
from rest_framework.routers import DefaultRouter
from rest_framework.routers import SimpleRouter
2019-09-13 09:43:12 +03:00
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
2024-02-13 13:57:53 +03:00
router = DefaultRouter() if settings.DEBUG else SimpleRouter()
2019-09-13 09:43:12 +03:00
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