Skip to content

Commit a4f5166

Browse files
author
koladev
committed
🐛 fix bug by adding cors headers package
1 parent 9d0f130 commit a4f5166

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

RestaurantCore/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
#third apps
4242
"rest_framework",
43+
"corsheaders",
44+
4345

4446
# installed apps
4547

@@ -49,6 +51,7 @@
4951
MIDDLEWARE = [
5052
"django.middleware.security.SecurityMiddleware",
5153
"django.contrib.sessions.middleware.SessionMiddleware",
54+
"corsheaders.middleware.CorsMiddleware",
5255
"django.middleware.common.CommonMiddleware",
5356
"django.middleware.csrf.CsrfViewMiddleware",
5457
"django.contrib.auth.middleware.AuthenticationMiddleware",
@@ -128,3 +131,5 @@
128131
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
129132

130133
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
134+
135+
CORS_ALLOW_ALL_ORIGINS = True

0 commit comments

Comments
 (0)