5👍
✅
From documentation for django-cors-headers
on PyPI it looks like you need to set the CORS_ALLOW_HEADERS
like so:
CORS_ALLOW_HEADERS = [
...
"Example-Header",
...
]
https://pypi.org/project/django-cors-headers/
If you want to dive deeper into CORS here is a thorough documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
3👍
For me CORS_ALLOW_HEADERS didn’t work.
after try couple of things I found out CORS_EXPOSE_HEADERS would work.
CORS_EXPOSE_HEADERS = [
"my-custom-header",
]
this means now I can set ‘my-custom-header’ (with its value) in response header.
- [Django]-Errors When Installing MySQL-python module for Python 2.7
- [Django]-Uploading Wagtail images from outside of wagtail
- [Django]-Displaying a message as a popup/alert in Django?
- [Django]-When does the queryset use its _result_cache, not hitting the database?
- [Django]-How to create a superuser in Django with Linux shell script?
Source:stackexchange.com