Skip to content

Commit

Permalink
add cors policy
Browse files Browse the repository at this point in the history
  • Loading branch information
C2dricLeroy committed Oct 20, 2024
1 parent 2fcac0f commit e48088c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vocab_dictionnary/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ django-rest-swagger
Pillow
djangorestframework-simplejwt
social-auth-app-django
python-dotenv
python-dotenv
django-cors-headers
9 changes: 9 additions & 0 deletions vocab_dictionnary/vocab_dictionnary/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'social_django',
'django.contrib.sites',
'authentication',
'corsheaders',
]

MIDDLEWARE = [
Expand All @@ -48,6 +49,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'social_django.middleware.SocialAuthExceptionMiddleware',
'corsheaders.middleware.CorsMiddleware',
]

ROOT_URLCONF = 'vocab_dictionnary.urls'
Expand Down Expand Up @@ -119,3 +121,10 @@
'rest_framework_simplejwt.authentication.JWTAuthentication',
],
}

CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"http://87.106.179.104:8000",
]


0 comments on commit e48088c

Please sign in to comment.