From 30a0d00259a19a295dc248e2fabfddd966db94e5 Mon Sep 17 00:00:00 2001 From: dkfla Date: Thu, 1 Aug 2024 17:09:44 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20cors=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mustgou/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mustgou/settings.py b/mustgou/settings.py index e7913d0..5b3d69d 100644 --- a/mustgou/settings.py +++ b/mustgou/settings.py @@ -49,9 +49,10 @@ ] MIDDLEWARE = [ + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", - "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", @@ -120,10 +121,9 @@ ] } -# CORS 관련 추가(모든 포트 허용) -CORS_ALLOW_ALL_ORIGINS = True -# HTTP methods 추가 +CORS_ALLOWED_ORIGINS = config("CORS_ALLOWED_ORIGINS", default="").split(",") + CORS_ALLOW_METHODS = { "DELETE", "GET",