add cors headers

This commit is contained in:
behruz-dev
2025-08-01 17:40:39 +05:00
parent 4c6a0b4445
commit bb7c49c895
4 changed files with 13 additions and 1 deletions

View File

@@ -2,4 +2,5 @@ from .jazzmin import *
from .drf_yasg import *
from .redis import *
from .rest_framework import *
from .rest_framework_simplejwt import *
from .rest_framework_simplejwt import *
from .cors_headers import *

View File

@@ -0,0 +1,8 @@
CORS_ALLOWED_ORIGINS = [
"http://localhost:8081",
"http://127.0.0.1:8081",
]
CSRF_TRUSTED_ORIGINS = [
"https://uyqur.felixits.uz",
]

View File

@@ -33,6 +33,7 @@ PACKAGES = [
'drf_yasg',
'rest_framework',
'rest_framework_simplejwt',
'corsheaders',
]
DJANGO_APPS = [
@@ -54,6 +55,7 @@ INSTALLED_APPS += APPS
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',