- pip install django-cors-headers
-
- INSTALLED_APPS = [
- ......
- 'corsheaders',
- ......
- ]
-
- MIDDLEWARE = [
- ......
- 'corsheaders.middleware.CorsMiddleware',
- 'django.middleware.common.CommonMiddleware',
- ......
- ]
-
- CORS_ORIGIN_ALLOW_ALL = True
- CORS_ALLOW_CREDENTIALS = True
-