roymeo
0
Q:

django-cors-headers

CORS_ORIGIN_WHITELIST = (
    'google.com',
    'hostname.example.com'
)
0
python -m pip install django-cors-headers
0
CORS_ALLOWED_ORIGINS = [
    "https://example.com",
    "https://sub.example.com",
    "http://localhost:8080",
    "http://127.0.0.1:9000"
]
0
MIDDLEWARE = [
    ...
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
]
0
INSTALLED_APPS = [
    ...
    'corsheaders',
    ...
]
0

New to Communities?

Join the community