diff --git a/backend/project/config/settings.py b/backend/project/config/settings.py index 49aec92..f3239b1 100755 --- a/backend/project/config/settings.py +++ b/backend/project/config/settings.py @@ -49,6 +49,7 @@ INSTALLED_APPS = [ # third party apps "rest_framework", "rest_framework_simplejwt", + "corsheaders", "drf_yasg", # project apps "users.apps.UsersConfig", @@ -63,6 +64,8 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", ] ROOT_URLCONF = "config.urls" @@ -151,3 +154,7 @@ REST_FRAMEWORK = { if DEBUG and not (TESTING or MIGRATING): register_debug_toolbar() + +CORS_ALLOWED_ORIGINS = [ + "http://158.160.56.239:8080", +] diff --git a/backend/requirements/dev.txt b/backend/requirements/dev.txt index 626fcba..c2b2108 100644 --- a/backend/requirements/dev.txt +++ b/backend/requirements/dev.txt @@ -1,6 +1,4 @@ -black -sort-requirements -ruff==0.3.4 +django-debug-toolbar -r prod.txt --r test.txt +-r lint.txt diff --git a/backend/requirements/lint.txt b/backend/requirements/lint.txt new file mode 100644 index 0000000..40b7f22 --- /dev/null +++ b/backend/requirements/lint.txt @@ -0,0 +1,2 @@ +sort-requirements +ruff diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index b5c3756..9e72ac0 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -8,3 +8,4 @@ djangorestframework-simplejwt==5.3.1 django-filter==24.2 Pillow==10.2.0 drf-yasg==1.21.7 +django-cors-headers diff --git a/backend/requirements/test.txt b/backend/requirements/test.txt deleted file mode 100644 index 2e685ea..0000000 --- a/backend/requirements/test.txt +++ /dev/null @@ -1 +0,0 @@ -django-debug-toolbar==4.3.0