From 74ea8942cc3f8221cf0b93ae1237d4dcdd9473dc Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Tue, 1 Jul 2025 16:17:53 +0700 Subject: [PATCH] setting cors --- freekake_api/freekake_api/settings.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/freekake_api/freekake_api/settings.py b/freekake_api/freekake_api/settings.py index 2856aee..43d0253 100644 --- a/freekake_api/freekake_api/settings.py +++ b/freekake_api/freekake_api/settings.py @@ -145,11 +145,14 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -CORS_ALLOWED_ORIGINS = [ - "http://localhost:3000", - "http://localhost:5173", - "http://127.0.0.1:5173", -] +# CORS_ALLOWED_ORIGINS = [ +# "http://localhost:3000", +# "http://localhost:5173", +# "http://127.0.0.1:5173", +# ] +CORS_ALLOWED_ORIGINS = config( + "CORS_ALLOWED_ORIGINS", + default="http://localhost:3000,http://localhost:5173,http://127.0.0.1:5173", cast=Csv()) REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS':