accessing request headers on django/python
As of django 2.2 HttpRequest.headers
were added to allow simple access to a request’s headers. So now you can also get authentication header using get()
function on request.headers
request.headers.get('Authorization')
This will give you value token value back.
Bearer eyJ0eYourToken...
https://docs.djangoproject.com/en/2.2/ref/request-response/#django.http.HttpRequest.headers