django-cors-headers

C++
$ pipenv install django-cors-headers
# or
$ pip install django-cors-headerspython -m pip install django-cors-headersMIDDLEWARE = [
    ...
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
]CORS_ORIGIN_WHITELIST = (
    'google.com',
    'hostname.example.com'
)CORS_ALLOWED_ORIGINS = [
    "https://example.com",
    "https://sub.example.com",
    "http://localhost:8080",
    "http://127.0.0.1:9000"
]INSTALLED_APPS = [
    ...
    'corsheaders',
    ...
]
Source

Also in C++: