I am new to django trying to write some apis. Django has user based authentication request.user.is_authenticated() to check whether a valid user is logged in or not. There is also session authentication. 1. How session authentication is different than django user based authentication? 2. Which is more secure?
I am trying to write rest apis that calls third party apis.
3.Is it posssible to use tastypie SessionAuthentication without using model?
I didn't find any rest api example that has implemented tastypie without model.
request.user.is_authenticated()tries to look for the cookie sent by the user in the session table. If the cookie exits in db, it means the client is authenticated. There is not distinction between "user based authentication" and session authentication. They are one and the same thing. - xyresrequest.userto the currently logged in user which it determines by looking at the cookie and finding a match in the session table. So,request.user.is_authenticatedis still, by proxy, session based auth. - xyres