django-cors-headers package installed and configurated

This commit is contained in:
behruz-dev
2025-11-22 21:57:38 +05:00
parent 15835b4c2d
commit 25e69d3060
3 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
CORS_ALLOWED_ORIGINS = [
"https://example.com",
"http://localhost:3000",
]
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_CREDENTIALS = True

View File

@@ -21,6 +21,7 @@ INSTALLED_APPS = [
'drf_yasg',
'rest_framework',
'rest_framework_simplejwt',
'corsheaders',
# local apps
'core.apps.shared',
@@ -32,6 +33,7 @@ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',

View File

@@ -1,6 +1,7 @@
asgiref==3.11.0
click==8.3.1
Django==5.2
django-cors-headers==4.9.0
django-environ==0.12.0
djangorestframework==3.16.1
djangorestframework_simplejwt==5.5.1