diff --git a/containers/backend/api/urls.py b/containers/backend/api/urls.py index 647cd02..e9bb13c 100644 --- a/containers/backend/api/urls.py +++ b/containers/backend/api/urls.py @@ -1,15 +1,16 @@ -import rest_framework_jwt.views -from django.conf.urls import url, include +import rest_framework_simplejwt.views +from django.urls import include, path from rest_framework.routers import DefaultRouter from api import views router = DefaultRouter() -router.register(r'passwords', views.PasswordViewSet, base_name='passwords') +router.register(r"passwords", views.PasswordViewSet, basename="passwords") urlpatterns = [ - url(r'^', include(router.urls)), - url(r'^tokens/auth/', rest_framework_jwt.views.obtain_jwt_token), - url(r'^tokens/refresh/', rest_framework_jwt.views.refresh_jwt_token), - url(r'^auth/', include('djoser.urls')), + path("", include(router.urls)), + path("tokens/auth/", rest_framework_simplejwt.views.token_obtain_pair), + path("tokens/refresh/", rest_framework_simplejwt.views.token_refresh), + path("auth/", include("djoser.urls")), + path("auth/", include("djoser.urls.jwt")), ] diff --git a/containers/backend/lesspass/settings.py b/containers/backend/lesspass/settings.py index a2c5e31..a4c1f2f 100644 --- a/containers/backend/lesspass/settings.py +++ b/containers/backend/lesspass/settings.py @@ -136,7 +136,7 @@ REST_FRAMEWORK = { 'rest_framework.filters.SearchFilter', ), 'DEFAULT_AUTHENTICATION_CLASSES': ( - 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', + 'rest_framework_simplejwt.authentication.JWTAuthentication', 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', ), diff --git a/containers/backend/requirements.txt b/containers/backend/requirements.txt index c0a58b6..2dd5985 100644 --- a/containers/backend/requirements.txt +++ b/containers/backend/requirements.txt @@ -1,10 +1,10 @@ -Django==1.11.23 -django-cors-middleware==1.3.1 -djangorestframework==3.6.2 -djangorestframework-jwt==1.10.0 -psycopg2-binary==2.8.3 -gunicorn==19.7.1 -djoser==0.5.4 +Django==3.0.6 +django-cors-middleware==1.5.0 +djangorestframework==3.11.0 +djangorestframework-simplejwt==4.4.0 +psycopg2-binary==2.8.5 +gunicorn==20.0.4 +djoser==2.0.3 envparse==0.2.0 # tests -factory-boy==2.8.1 +factory-boy==2.12.0