django-cors-headers package installed and configurated
This commit is contained in:
8
config/conf/corsheaders.py
Normal file
8
config/conf/corsheaders.py
Normal file
@@ -0,0 +1,8 @@
|
||||
CORS_ALLOWED_ORIGINS = [
|
||||
"https://example.com",
|
||||
"http://localhost:3000",
|
||||
]
|
||||
|
||||
CORS_ALLOW_ALL_ORIGINS = True
|
||||
|
||||
CORS_ALLOW_CREDENTIALS = True
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user