jwt token 제어 기능 추가
All checks were successful
Build And Test / build-and-push (push) Successful in 1m48s
All checks were successful
Build And Test / build-and-push (push) Successful in 1m48s
This commit is contained in:
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
|
|||||||
import os
|
import os
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
@ -48,13 +49,15 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
# by.sdjo 2025-04-22
|
# by.sdjo
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'rest_framework_simplejwt',
|
'rest_framework_simplejwt',
|
||||||
|
'rest_framework_simplejwt.token_blacklist',
|
||||||
'drf_yasg',
|
'drf_yasg',
|
||||||
'corsheaders',
|
'corsheaders',
|
||||||
# create by.sdjo 2025-04-22
|
# create by.sdjo 2025-04-22
|
||||||
'users', # 2025-04-22 custom app create
|
'users', # 2025-04-22 custom app create
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
AUTH_USER_MODEL = 'users.CustomUser'
|
AUTH_USER_MODEL = 'users.CustomUser'
|
||||||
@ -114,16 +117,12 @@ TEMPLATES = [
|
|||||||
|
|
||||||
WSGI_APPLICATION = 'auth_prj.wsgi.application'
|
WSGI_APPLICATION = 'auth_prj.wsgi.application'
|
||||||
|
|
||||||
|
SIMPLE_JWT = {
|
||||||
# Database
|
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=5),
|
||||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
"REFRESH_TOKEN_LIFETIME": timedelta(days=1),
|
||||||
|
"ROTATE_REFRESH_TOKENS": True,
|
||||||
# DATABASES = {
|
"BLACKLIST_AFTER_ROTATION": True, # 사용한 토큰은 갱신하면 블랙리스트처리됨
|
||||||
# 'default': {
|
}
|
||||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
# 'NAME': BASE_DIR / 'db.sqlite3',
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
Reference in New Issue
Block a user