Shell/Bash: django-cors-headers Example

By

Shell/Bash Example: This is the "django-cors-headers" Example. compiled from many sources on the internet by SimpleTutorials.org

django-cors-headers

$ pipenv install django-cors-headers
# or
$ pip install django-cors-headers

django-cors-headers

MIDDLEWARE = [
    ...
    'corsheaders.middleware.CorsMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
]

django-cors-headers

python -m pip install django-cors-headers

django-cors-headers

CORS_ALLOWED_ORIGINS = [
    "https://example.com",
    "https://sub.example.com",
    "http://localhost:8080",
    "http://127.0.0.1:9000"
]

Access-Control-Allow-Origin django

CORS_ORIGIN_WHITELIST = (
    'google.com',
    'hostname.example.com'
)

django-cors-headers

INSTALLED_APPS = [
    ...
    'corsheaders',
    ...
]



* Summary: This "django-cors-headers" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others