Integrate CORS with Django CSRF protection
mainCORS and CSRF are separate mechanisms. django-cors-headers does not automatically exempt sites from Django's Referer checking on secure requests. To allow cross-site requests that include CSRF protection, you must also add the allowed origins to Django's CSRF_TRUSTED_ORIGINS setting.
Example configuration:
CORS_ALLOWED_ORIGINS = [
"https://read-only.example.com",
"https://read-and-write.example.com",
]
CSRF_TRUSTED_ORIGINS = [
"https://read-and-write.example.com",
]