Incase you are using djangorestframework-simplejwt
for authentication and Would like to use channels==2.0
.
On web sending token
over headers is not possible if using js WebSocket available API.
To go around this you can send your token on the url as indicated below
wws://example.com?token=[a_valid_token]
The middleware above can be added on routing.py
to supply a valid user to the consumer.
NB :: Securitywise this is not advisable to do.