24 lines
640 B
Python
24 lines
640 B
Python
from django.urls import path
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from apps.accounts.views import (
|
|
ApiKeyViewSet,
|
|
CsrfView,
|
|
LoginView,
|
|
LogoutView,
|
|
MeView,
|
|
UserViewSet,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register("users", UserViewSet, basename="user")
|
|
router.register("api-keys", ApiKeyViewSet, basename="api-key")
|
|
|
|
urlpatterns = [
|
|
path("auth/csrf/", CsrfView.as_view(), name="auth-csrf"),
|
|
path("auth/login/", LoginView.as_view(), name="auth-login"),
|
|
path("auth/logout/", LogoutView.as_view(), name="auth-logout"),
|
|
path("auth/me/", MeView.as_view(), name="auth-me"),
|
|
*router.urls,
|
|
]
|