From eb419e7e960d83895ebc3b3a9ea901fa9aae3a2c Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 1 Jan 2017 17:23:43 -0600 Subject: [PATCH] Allow CORS. --- bikeshop_project/bikeshop/settings/development.py | 15 +++++++++++---- requirements/development.txt | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bikeshop_project/bikeshop/settings/development.py b/bikeshop_project/bikeshop/settings/development.py index 2e3509b..dec365d 100644 --- a/bikeshop_project/bikeshop/settings/development.py +++ b/bikeshop_project/bikeshop/settings/development.py @@ -49,13 +49,20 @@ LOGGING = { }, } -# INSTALLED_APPS += [ -# 'debug_toolbar' -# ] +INSTALLED_APPS += [ + 'corsheaders', + # 'debug_toolbar' +] + +MIDDLEWARE_CLASSES.insert(0, 'django.middleware.common.CommonMiddleware') -# MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware'] +# MIDDLEWARE_CLASSES += [ +# 'debug_toolbar.middleware.DebugToolbarMiddleware' +# ] # Don't worry about IP addresses, just show the toolbar. DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR_CALLBACK': lambda *args: True } + +CORS_ORIGIN_ALLOW_ALL = True diff --git a/requirements/development.txt b/requirements/development.txt index 1f503bd..1ba3966 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,3 +1,4 @@ -r base.txt -r testing.txt django-debug-toolbar +django-cors-headers