Skip to content

Commit

Permalink
Merge pull request #3 from Team-MailedIt/feature-cors
Browse files Browse the repository at this point in the history
feat: CORS 설정
  • Loading branch information
kynzun authored Dec 2, 2021
2 parents cff2367 + 4b0ab06 commit 0240ae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ asgiref==3.4.1
cffi==1.15.0
cryptography==35.0.0
Django==3.0.8
django-cors-headers==3.10.0
django-environ==0.4.5
djangorestframework==3.12.4
djangorestframework-simplejwt==5.0.0
Expand Down
5 changes: 5 additions & 0 deletions vote_mailedit/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,23 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"account",
"corsheaders",
]

MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
]

# Allow every Host
CORS_ORIGIN_ALLOW_ALL = True

REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"rest_framework_simplejwt.authentication.JWTAuthentication",
Expand Down

0 comments on commit 0240ae2

Please sign in to comment.