Hello friend,
I noticed that you are using the standard token authentication system. However, this method does not correspond to JWT.
Since you want to use authentication through JWT with DRF, you must use:
2) Next, you must correctly configure these Django modules.
3) When everything is properly configured, you must first obtain the access token and refresh token through a previously created user login.
4) Once you have the access token, you must send it to the request head as follows, for example:
{Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU5NTYwMzIyNSwianRpIjoiY2QxYTRiYWJiZTgzNDVhMjlkMGJmYTIzNTc0Zjk0ZjEiLCJ1c2VyX2lkIjo4fQ.i6bmtiqFyWyxo7mMuZxQjN9RvM-DjaiOwRVxeRBdiwM"}
5) Every 5 minutes you must request a new access token through the refresh token, but now in the body of the request:
{ "Refresh", "ppADdAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTU5NTYwMzIyNSwianRpIjoiY2QxYTRiYWJiZTgzNDVhMjlkMGJmYTIzNTc0Zjk0ZjEiLCJ1c2VyX2lkIjo4fQ.i6bmtiqFyWyxo7mMuZxQjN9RvM-DjaiOwRVxeRBccdSA"}
Hope this helps!
See you later!