Add CORS whitelist

This commit is contained in:
Tanner Collin 2017-08-26 17:59:25 +00:00
parent 870e48a516
commit 0ad016791e

View File

@ -45,6 +45,7 @@ INSTALLED_APPS = [
'allauth', 'allauth',
'allauth.account', 'allauth.account',
'rest_auth.registration', 'rest_auth.registration',
'corsheaders',
] ]
SITE_ID = 1 SITE_ID = 1
@ -79,7 +80,12 @@ REST_FRAMEWORK = {
'PAGE_SIZE': 10 'PAGE_SIZE': 10
} }
CORS_ORIGIN_WHITELIST = (
'localhost:3000',
)
MIDDLEWARE = [ MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',