diff --git a/parkkihubi/settings.py b/parkkihubi/settings.py index cb0be44b..49327707 100644 --- a/parkkihubi/settings.py +++ b/parkkihubi/settings.py @@ -71,6 +71,7 @@ 'django.contrib.staticfiles', 'django.contrib.gis', 'raven.contrib.django.raven_compat', + 'corsheaders', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_gis', @@ -88,6 +89,7 @@ ############## MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', + 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'parkkihubi.middleware.AdminTimezoneMiddleware', @@ -164,6 +166,7 @@ 'TEST_REQUEST_DEFAULT_FORMAT': 'json', } +CORS_ORIGIN_ALLOW_ALL = True ############## # Parkkihubi # diff --git a/requirements.in b/requirements.in index 7a35fe74..19bbef0c 100644 --- a/requirements.in +++ b/requirements.in @@ -23,3 +23,4 @@ owslib # Misc pytz +django-cors-headers diff --git a/requirements.txt b/requirements.txt index 28f1ba8c..89f0c18c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ certifi==2018.1.18 # via requests chardet==3.0.4 # via requests django==1.11.9 +django-cors-headers==2.1.0 django-environ==0.4.4 django-filter==1.1.0 djangorestframework==3.7.7