login route
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
from django.urls import path
|
||||
# from . views import ()
|
||||
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',
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user