enable cors django rest framework code example
Example 1: django-cors-headers
MIDDLEWARE = [
...
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
...
]
Example 2: django-cors-headers
python -m pip install django-cors-headers