[fix] cors headers

This commit is contained in:
Data-Name-ID
2024-03-31 21:44:14 +03:00
parent 04d4e83d1f
commit 3fa3766356
5 changed files with 12 additions and 5 deletions
+7
View File
@@ -49,6 +49,7 @@ INSTALLED_APPS = [
# third party apps
"rest_framework",
"rest_framework_simplejwt",
"corsheaders",
"drf_yasg",
# project apps
"users.apps.UsersConfig",
@@ -63,6 +64,8 @@ MIDDLEWARE = [
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"corsheaders.middleware.CorsMiddleware",
"django.middleware.common.CommonMiddleware",
]
ROOT_URLCONF = "config.urls"
@@ -151,3 +154,7 @@ REST_FRAMEWORK = {
if DEBUG and not (TESTING or MIGRATING):
register_debug_toolbar()
CORS_ALLOWED_ORIGINS = [
"http://158.160.56.239:8080",
]
+2 -4
View File
@@ -1,6 +1,4 @@
black
sort-requirements
ruff==0.3.4
django-debug-toolbar
-r prod.txt
-r test.txt
-r lint.txt
+2
View File
@@ -0,0 +1,2 @@
sort-requirements
ruff
+1
View File
@@ -8,3 +8,4 @@ djangorestframework-simplejwt==5.3.1
django-filter==24.2
Pillow==10.2.0
drf-yasg==1.21.7
django-cors-headers
-1
View File
@@ -1 +0,0 @@
django-debug-toolbar==4.3.0