Add CORS support to allow cross origin API requests
This commit is contained in:
@@ -45,6 +45,7 @@ INSTALLED_APPS = (
|
||||
'django.contrib.comments',
|
||||
'django.contrib.staticfiles',
|
||||
# 3rd party
|
||||
'corsheaders',
|
||||
'south',
|
||||
'rest_framework_swagger',
|
||||
'filetransfers',
|
||||
@@ -102,6 +103,7 @@ INSTALLED_APPS = (
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
@@ -262,3 +264,6 @@ REST_FRAMEWORK = {
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
)
|
||||
}
|
||||
|
||||
# CORS
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
|
||||
Reference in New Issue
Block a user