mirror of
https://github.com/franjsco/segnalibre-backend
synced 2025-02-16 19:40:41 +01:00
Implement Djoser library to handle users
This commit is contained in:
parent
a181de664f
commit
c31c36e768
@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'rest_framework',
|
||||
'djoser',
|
||||
'corsheaders',
|
||||
'segnalibre_app'
|
||||
]
|
||||
@ -136,4 +137,8 @@ REST_FRAMEWORK = {
|
||||
),
|
||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
||||
'PAGE_SIZE': 10
|
||||
}
|
||||
}
|
||||
|
||||
SIMPLE_JWT = {
|
||||
'AUTH_HEADER_TYPES': ('JWT'),
|
||||
}
|
||||
|
@ -1,18 +1,12 @@
|
||||
from django.urls import path, include
|
||||
from django.conf.urls import url
|
||||
from . import views
|
||||
from rest_framework_simplejwt.views import (
|
||||
TokenObtainPairView,
|
||||
TokenRefreshView,
|
||||
TokenVerifyView)
|
||||
|
||||
prefix = 'v1/'
|
||||
|
||||
urlpatterns = [
|
||||
path(prefix + 'users/', views.UserList.as_view()),
|
||||
path(prefix + 'books/', views.BookList.as_view()),
|
||||
path(prefix +'books/<int:pk>/', views.BookDetail.as_view()),
|
||||
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')
|
||||
url(r'^v1/auth/', include('djoser.urls')),
|
||||
url(r'^v1/auth/', include('djoser.urls.jwt')),
|
||||
path('v1/books/', views.BookList.as_view()),
|
||||
path('v1/books/<int:pk>/', views.BookDetail.as_view()),
|
||||
#path('api-auth/', include('rest_framework.urls')),
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user