5👍
✅
You said it yourself, you’re passing it in the headers, so you need to get it from there. DRF does not do anything special to access the headers, so it proxies to the underlying Django HttpRequest object, which makes them available via the META
attribute, converted to uppercase and prefixed by HTTP_
:
token = request.META.get("HTTP_TOKEN", "")
Source:stackexchange.com