add CORS to headers

This commit is contained in:
FilipKudlacz 2019-04-08 14:37:41 +02:00
parent 991b41d05d
commit c5f39ca39e
10 changed files with 5 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -37,11 +37,13 @@ INSTALLED_APPS = [
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'magazine' 'magazine',
'corsheaders'
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
@ -123,3 +125,5 @@ STATICFILES_DIRS = [
] ]
STATIC_URL = '/static/' STATIC_URL = '/static/'
CORS_ORIGIN_ALLOW_ALL = True