# Bash
> pip install django-cors-headers
# /mysite/settings.py
from corsheaders.defaults import default_headers
# Application definition
INSTALLED_APPS = [
'corsheaders',
# ...
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
# ...
]
# CORS
CORS_ORIGIN_WHITELIST = [
'http://localhost:3000',
]
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_HEADERS = list(default_headers) + [ 'token' ]