[backend]: Добавлена базовая JWT аутентификация

This commit is contained in:
2022-09-10 15:46:03 +03:00
parent c0141bc79d
commit ea9cde238e
11 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@@ -0,0 +1,8 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy
class AuthConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "authentication"
verbose_name = gettext_lazy("authentication")

View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@@ -0,0 +1,9 @@
from django.urls import path
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.views import TokenRefreshView
urlpatterns = [
path("token", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("token/refresh", TokenRefreshView.as_view(), name="token_refresh"),
]

View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.