Answer the question
In order to leave comments, you need to log in
How to use your token instead of sessionid in django?
I use JWT, on the client side in Angular they get a token and write it to cookies, and it works. How to do the same through the login in djangorestframework or through the admin panel? As I suppose it needs to be redefined in the middleware
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
class MyBackend:
def authenticate(self, request, username=None, password=None):
# Check the username/password and return a user.
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question