2019-11-23 01:36:02 +01:00
|
|
|
from django.urls import path, include
|
|
|
|
from . import views
|
2019-11-26 10:04:18 +01:00
|
|
|
from rest_framework_simplejwt.views import (
|
|
|
|
TokenObtainPairView,
|
|
|
|
TokenRefreshView,
|
|
|
|
TokenVerifyView)
|
2019-11-23 01:36:02 +01:00
|
|
|
|
2019-11-23 12:22:24 +01:00
|
|
|
prefix = 'v1/'
|
|
|
|
|
2019-11-23 01:36:02 +01:00
|
|
|
urlpatterns = [
|
2019-11-23 12:22:24 +01:00
|
|
|
path(prefix + 'users/', views.UserList.as_view()),
|
|
|
|
path(prefix + 'books/', views.BookList.as_view()),
|
|
|
|
path(prefix +'books/<int:pk>/', views.BookDetail.as_view()),
|
2019-11-26 10:04:18 +01:00
|
|
|
path('api-auth/', include('rest_framework.urls')),
|
|
|
|
path(prefix + 'auth/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
|
|
|
path(prefix + 'auth/refresh', TokenRefreshView.as_view(), name='token_refresh'),
|
|
|
|
path(prefix + 'auth/verify', TokenVerifyView.as_view(), name='token_verify')
|
2019-11-23 01:36:02 +01:00
|
|
|
]
|