Skip to content

Commit e9fd282

Browse files
committed
URLPathVersioning 추가
1 parent 22157f5 commit e9fd282

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pyconkr/settings.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
https://docs.djangoproject.com/en/4.1/ref/settings/
1111
"""
1212
import os
13-
from pathlib import Path
13+
import pathlib
1414

15-
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16-
BASE_DIR = Path(__file__).resolve().parent.parent
15+
# Build paths inside the project like this: BASE_DIR / "subdir".
16+
BASE_DIR = pathlib.Path(__file__).resolve().parent.parent
1717

1818

1919
# Quick-start development settings - unsuitable for production
@@ -188,13 +188,17 @@
188188
# YOUR SETTINGS
189189
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
190190
"DEFAULT_AUTHENTICATION_CLASSES": (
191-
'rest_framework.authentication.BasicAuthentication',
192-
# 'rest_framework.authentication.SessionAuthentication',
191+
"rest_framework.authentication.BasicAuthentication",
192+
# "rest_framework.authentication.SessionAuthentication",
193193
"rest_framework_simplejwt.authentication.JWTAuthentication",
194194
"dj_rest_auth.jwt_auth.JWTCookieAuthentication",
195195
),
196+
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.URLPathVersioning",
197+
"DEFAULT_VERSION": "2023",
198+
"ALLOWED_VERSIONS": ["2023", "2024"],
196199
}
197200

201+
198202
SPECTACULAR_SETTINGS = {
199203
"TITLE": "pyconkr-api-v2",
200204
"DESCRIPTION": "파이콘 한국 웹서비스용 API (2023 ~ )",
@@ -207,8 +211,7 @@
207211
"persistAuthorization": True,
208212
"displayOperationId": True,
209213
},
210-
# available SwaggerUI versions: https://github.com/swagger-api/swagger-ui/releases
211-
"SWAGGER_UI_DIST": "//unpkg.com/[email protected]",
214+
"PREPROCESSING_HOOKS": ["pyconkr.openapi.preprocessing_filter_spec"],
212215
}
213216

214217
# CORS_ALLOW_ALL_ORIGINS = True

0 commit comments

Comments
 (0)