From be325e9a830fd6cc683b2fa0e51e4a0ccb3bc6f1 Mon Sep 17 00:00:00 2001 From: ybkang1108 Date: Thu, 1 Aug 2024 20:50:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20api=20=EC=9A=94=EC=B2=AD=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + mustgou/settings.py | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index ac06ba2..2642e98 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ db.sqlite3 venv/ mguvenv/ Python-3.12.0/ +django.log diff --git a/mustgou/settings.py b/mustgou/settings.py index 5b3d69d..69193d0 100644 --- a/mustgou/settings.py +++ b/mustgou/settings.py @@ -124,16 +124,16 @@ CORS_ALLOWED_ORIGINS = config("CORS_ALLOWED_ORIGINS", default="").split(",") -CORS_ALLOW_METHODS = { +CORS_ALLOW_METHODS = ( "DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT", -} +) -CORS_ALLOW_HEADERS = { +CORS_ALLOW_HEADERS = ( "accept", "accept-encoding", "authorization", @@ -143,6 +143,27 @@ "user-agent", "x-csrftoken", "x-requested-with", +) + + +# API 로그 확인 +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "handlers": { + "file": { + "level": "DEBUG", + "class": "logging.FileHandler", + "filename": os.path.join(BASE_DIR, "django.log"), + }, + }, + "loggers": { + "django": { + "handlers": ["file"], + "level": "DEBUG", + "propagate": True, + }, + }, }