Django JWT authentication - user is anonymous in middleware
问题 I am using Django JWT to power up authentication system in my project. Also, I have a middleware, and the problem is that inside it, the user is anonymous for some reason, while in the view I am able to access the correct user by request.user . This issue is driving me crazy because some time ago this code worked perfectly ! Is this JWT's bug or I am doing something wrong ? class TimezoneMiddleware(MiddlewareMixin): def process_request(self, request): # request.user is ANONYMOUS HERE !!!! if