From 62237c9a3c627ddefd541a3033eee2ad916ee85d Mon Sep 17 00:00:00 2001 From: keannu125 Date: Tue, 28 Feb 2023 22:40:37 +0800 Subject: [PATCH] Added corsheader --- ivy/config/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ivy/config/settings.py b/ivy/config/settings.py index 5da41fe..ed7d9db 100644 --- a/ivy/config/settings.py +++ b/ivy/config/settings.py @@ -40,11 +40,13 @@ INSTALLED_APPS = [ 'rest_framework', 'rest_framework.authtoken', 'djoser', + 'corsheaders', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + "corsheaders.middleware.CorsMiddleware", 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -141,3 +143,7 @@ EMAIL_HOST = 'sandbox.smtp.mailtrap.io' EMAIL_HOST_USER = '54ff6949e39105' EMAIL_HOST_PASSWORD = 'c59d3eaa05f98d' EMAIL_PORT = '2525' + +CORS_ALLOWED_ORIGINS = [ + "http://localhost:3000", +]