add cors
This commit is contained in:
@@ -46,6 +46,7 @@ PACKAGES = [
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
'cacheops',
|
||||
'corsheaders',
|
||||
]
|
||||
|
||||
INSTALLED_APPS = []
|
||||
@@ -58,6 +59,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',
|
||||
@@ -151,4 +153,13 @@ from config.conf.rest_framework import *
|
||||
from config.conf.simplejwt import *
|
||||
from config.conf.celery import *
|
||||
from config.conf.redis import *
|
||||
# from config.conf.unfold import *
|
||||
# from config.conf.unfold import *
|
||||
|
||||
|
||||
CORS_ALLOWED_ORIGINS = [
|
||||
"http://localhost:3000",
|
||||
]
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
"http://trustme.felixits.uz"
|
||||
]
|
||||
|
||||
@@ -15,3 +15,4 @@ pytest-django
|
||||
django-cacheops==7.2
|
||||
django-unfold==0.62.0
|
||||
drf_yasg==1.21.10
|
||||
django-cors-headers==4.7.0
|
||||
Reference in New Issue
Block a user