Permalink
Browse files

Add CORS.

  • Loading branch information...
nicksergeant committed Dec 7, 2016
1 parent 87507ed commit 9b4b75a7f1d63776303299a9befe0d9641934cbb
Showing with 4 additions and 0 deletions.
  1. +1 −0 requirements.txt
  2. +3 −0 settings.py
View
@@ -6,6 +6,7 @@ certifi==2016.9.26
dj-database-url==0.4.1
dj-static==0.0.6
django-annoying==0.10.3
+django-cors-headers==1.3.1
django-debug-toolbar==1.3.2
django-extensions==1.7.4
django-haystack==2.5.1
View
@@ -49,6 +49,7 @@
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
BASE_PATH = os.path.dirname(__file__)
CSRF_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
+CORS_ORIGIN_ALLOW_ALL = True
DEBUG = True if 'DEBUG' in os.environ else False
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_EMAIL', 'support@snipt.net')
EMAIL_BACKEND = 'postmark.django_backend.EmailBackend'
@@ -119,6 +120,7 @@
INSTALLED_APPS = (
'accounts',
'blogs',
+ 'corsheaders',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -157,6 +159,7 @@
'django.middleware.security.SecurityMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',

0 comments on commit 9b4b75a

Please sign in to comment.