Am working on a personal project, my plan is to build Mobile App in the future for it. I have already developed the backend api endpoints using Django Rest Framework and JWT. But the challenge now is that how can i consume the rest api endpoints from my same django project. ? I know how to send POST and GET request from Django. But how do i use the access and refresh token in the header for every request that need authentication. From what i know so far, the access token expire so soon, and i need to store the refresh token on cookie. And whenever i need it i will just get the refresh token from the cookie and use it to send a post request to the refresh token endpoint, which will now get me access token. But my question is how do i do it ?
I mean the code to login user and alway make sure the access token is present whenever am sending a request to the api endpoint