DEV Community

Discussion on: Why is Django REST Framework lying to me?

Collapse
 
imcatta profile image
imcatta

Hi! I'm not a django rest expert, but i think i figured out what's wrong.
The SessionAuthentication class is not used to sign in the user, but to check if a request comes from an authenticated user.
To login using regular session cookie you're supposed to use the standard LoginView class

Collapse
 
rhymes profile image
rhymes

Thanks for the comment! I figured SessionAuthentication wasn't the correct one, after a few trials.

The only issue I see using directly LoginView is that it entails a server side template. That's why I didn't use it. Check the update in the post about it.

I'm still a little surprised about how complicated is this but it could be 100% because I'm not a Django expert either.