Implement Djoser library to handle users
This commit is contained in:
parent
a181de664f
commit
eb488c8827
|
@ -1,8 +1,10 @@
|
||||||
astroid==2.3.3
|
astroid==2.3.3
|
||||||
Django==2.2.7
|
Django==2.2.7
|
||||||
django-cors-headers==3.2.0
|
django-cors-headers==3.2.0
|
||||||
|
django-templated-mail==1.1.1
|
||||||
djangorestframework==3.10.3
|
djangorestframework==3.10.3
|
||||||
djangorestframework-simplejwt==4.3.0
|
djangorestframework-simplejwt==4.3.0
|
||||||
|
djoser==2.0.3
|
||||||
isort==4.3.21
|
isort==4.3.21
|
||||||
lazy-object-proxy==1.4.3
|
lazy-object-proxy==1.4.3
|
||||||
mccabe==0.6.1
|
mccabe==0.6.1
|
||||||
|
|
|
@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
|
'djoser',
|
||||||
'corsheaders',
|
'corsheaders',
|
||||||
'segnalibre_app'
|
'segnalibre_app'
|
||||||
]
|
]
|
||||||
|
@ -137,3 +138,7 @@ REST_FRAMEWORK = {
|
||||||
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
||||||
'PAGE_SIZE': 10
|
'PAGE_SIZE': 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SIMPLE_JWT = {
|
||||||
|
'AUTH_HEADER_TYPES': ('JWT'),
|
||||||
|
}
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
from django.urls import path, include
|
from django.urls import path, include
|
||||||
|
from django.conf.urls import url
|
||||||
from . import views
|
from . import views
|
||||||
from rest_framework_simplejwt.views import (
|
|
||||||
TokenObtainPairView,
|
|
||||||
TokenRefreshView,
|
|
||||||
TokenVerifyView)
|
|
||||||
|
|
||||||
prefix = 'v1/'
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path(prefix + 'users/', views.UserList.as_view()),
|
url(r'^v1/auth/', include('djoser.urls')),
|
||||||
path(prefix + 'books/', views.BookList.as_view()),
|
url(r'^v1/auth/', include('djoser.urls.jwt')),
|
||||||
path(prefix +'books/<int:pk>/', views.BookDetail.as_view()),
|
path('v1/books/', views.BookList.as_view()),
|
||||||
path('api-auth/', include('rest_framework.urls')),
|
path('v1/books/<int:pk>/', views.BookDetail.as_view()),
|
||||||
path(prefix + 'auth/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
#path('api-auth/', include('rest_framework.urls')),
|
||||||
path(prefix + 'auth/refresh', TokenRefreshView.as_view(), name='token_refresh'),
|
|
||||||
path(prefix + 'auth/verify', TokenVerifyView.as_view(), name='token_verify')
|
|
||||||
]
|
]
|
Loading…
Reference in New Issue