A Django App that adds Cross-Origin Resource Sharing headers to responses
A Django App that adds Cross-Origin Resource Sharing (CORS) headers to responses. This allows in-browser requests to your Django application from other origins.
About CORS
Adding CORS headers allows your resources to be accessed on other domains. It’s important you understand the implications before adding the headers, since you could be unintentionally opening up your site’s private data to others.
Requirements
Python 3.6 to 3.9 supported.
Django 2.2 to 3.2 supported.
Are your tests slow? Check out my book Speed Up Your Django Tests which covers loads of best practices so you can write faster, more accurate tests.
Setup
Install from pip:
python -m pip install django-cors-headers
and then add it to your installed apps:
INSTALLED_APPS = [
...,
"corsheaders",
...,
]
Make