Skip to content

Commit 116829b

Browse files
committed
fix: disable cors
1 parent 4ce90fa commit 116829b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pwm_item_api/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
INSTALLED_APPS = [
3636
'django.contrib.auth',
3737
'django.contrib.contenttypes',
38+
'corsheaders',
3839
'django.contrib.sessions',
3940
'django.contrib.messages',
4041
'django.contrib.staticfiles',
@@ -49,8 +50,15 @@
4950
'django.contrib.auth.middleware.AuthenticationMiddleware',
5051
'django.contrib.messages.middleware.MessageMiddleware',
5152
'django.middleware.clickjacking.XFrameOptionsMiddleware',
53+
'corsheaders.middleware.CorsMiddleware',
54+
'django.middleware.common.CommonMiddleware',
5255
]
5356

57+
#CORS_ALLOW_ALL_ORIGINS = True
58+
#CORS_ALLOW_CREDENTIALS = True
59+
CORS_ALLOWED_ORIGINS = ['https://main--pwm-front-test.netlify.app']
60+
#CORS_ALLOWED_ORIGIN_REGEXES = []
61+
5462
ROOT_URLCONF = 'pwm_item_api.urls'
5563

5664
TEMPLATES = [

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
django==4.2.13
2+
django-cors-headers==4.4.0

0 commit comments

Comments
 (0)