Linking JWT and sessions via middleware

Hello, this is my first post! I’m exploring Django for my final school project. I’m building an SPA and use ajax requests, NGINX/Daphne, all within Docker containers, and it’s working well. I’m enhancing the website’s auth, and given the SPA nature, I believe using JWT tokens is suitable. However, I am also using Django sessions (I’ve built a custom user), which is convenient for accessing user information.

Can I combine JWT verification with Django user sessions using custom middleware (to check if the JWT is valid and to log in/log out the session accordingly), while still benefiting from my custom user on top of JWT Auth?

Is this a good practice, or is there a better approach I’m overlooking?

I hope I’ve made myself clear, despite it possibly being a novice question. Thank you!