28 lines
838 B
Python
28 lines
838 B
Python
from django.urls import path, include
|
|
from .views import LoginViewSet, LogoutView
|
|
from rest_framework.routers import DefaultRouter
|
|
from drf_spectacular.views import (
|
|
SpectacularAPIView,
|
|
SpectacularSwaggerView,
|
|
SpectacularRedocView,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register(r'', LoginViewSet, basename='auth')
|
|
|
|
urlpatterns = [
|
|
path('', include(router.urls)),
|
|
path('logout/', LogoutView.as_view(), name='auth-logout'),
|
|
path('schema/', SpectacularAPIView.as_view(), name='schema'),
|
|
path(
|
|
'docs/',
|
|
SpectacularSwaggerView.as_view(url_name='schema'),
|
|
name='swagger-ui',
|
|
),
|
|
# ReDoc UI - альтернативный вариант отображения доков:
|
|
path(
|
|
'redoc/',
|
|
SpectacularRedocView.as_view(url_name='schema'),
|
|
name='redoc',
|
|
),
|
|
] |