jwt token 제어 기능 추가
All checks were successful
Build And Test / build-and-push (push) Successful in 1m48s

This commit is contained in:
2025-05-20 00:47:07 +09:00
parent 23f0642610
commit a1b023cd4e
2 changed files with 11 additions and 12 deletions

View File

@ -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": {

View File

@ -1 +1 @@
0.0.6-r1 0.0.7