21 lines
414 B
Python
21 lines
414 B
Python
|
from django.conf import settings
|
||
|
from django.urls import path
|
||
|
|
||
|
from rest_framework import routers
|
||
|
|
||
|
from .views import login_view, logout_view
|
||
|
from .viewsets import UserViewset
|
||
|
|
||
|
|
||
|
if settings.DEBUG:
|
||
|
router = routers.DefaultRouter()
|
||
|
else:
|
||
|
router = routers.SimpleRouter()
|
||
|
|
||
|
router.register("users", UserViewset)
|
||
|
|
||
|
urlpatterns = router.urls + [
|
||
|
path("login/", login_view),
|
||
|
path("logout/", logout_view),
|
||
|
]
|