diff --git a/bro_hub/settings.py b/bro_hub/settings.py index 5a86822..d2d6ee3 100644 --- a/bro_hub/settings.py +++ b/bro_hub/settings.py @@ -41,6 +41,7 @@ "django.contrib.staticfiles", "rest_framework", "drf_yasg", + "corsheaders", "django_filters", "rest_framework_simplejwt", "encrypted_model_fields", @@ -54,6 +55,7 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", + "corsheaders.middleware.CorsMiddleware", ] ROOT_URLCONF = "bro_hub.urls" @@ -76,6 +78,9 @@ WSGI_APPLICATION = "bro_hub.wsgi.application" +CORS_ALLOWED_ORIGINS = [ + "http://localhost:4200", +] # Database # https://docs.djangoproject.com/en/5.0/ref/settings/#databases diff --git a/requirements.txt b/requirements.txt index 0b70743..99be17d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ django == 5.0.1 psycopg2-binary djangorestframework +django-cors-headers drf-yasg celery redis