Skip to content

Commit 7de63d4

Browse files
committed
Added CORS_ALLOW_HEADERS and rearranged middleware imports
1 parent fb09bbc commit 7de63d4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

config/settings/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@
9090
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
9191
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
9292

93+
CORS_ALLOW_HEADERS = [
94+
"accept",
95+
"authorization",
96+
"content-type",
97+
"user-agent",
98+
"x-csrftoken",
99+
"x-requested-with",
100+
]
101+
93102
CORS_ALLOWED_ORIGINS = [
94103
"http://localhost:3000",
95104
"http://sde-lrm.nasa-impact.net",
@@ -146,14 +155,14 @@
146155
# https://docs.djangoproject.com/en/dev/ref/settings/#middleware
147156
MIDDLEWARE = [
148157
"django.middleware.security.SecurityMiddleware",
158+
"corsheaders.middleware.CorsMiddleware",
149159
"django.contrib.sessions.middleware.SessionMiddleware",
150160
"django.middleware.locale.LocaleMiddleware",
151161
"django.middleware.common.CommonMiddleware",
152162
"django.middleware.csrf.CsrfViewMiddleware",
153163
"django.contrib.auth.middleware.AuthenticationMiddleware",
154164
"django.contrib.messages.middleware.MessageMiddleware",
155165
"django.middleware.clickjacking.XFrameOptionsMiddleware",
156-
"corsheaders.middleware.CorsMiddleware",
157166
"allauth.account.middleware.AccountMiddleware",
158167
]
159168

0 commit comments

Comments
 (0)