django SessionAuthentication

Overview

SessionAuthentication method: This method uses the session cookie (which is set through the normal Django login and logout views) to check out if there’s an authenticated user and get his username. This method works only in the same session (browser window) as the one that actually did the login but this should be enough for most cases.

After you log in with Django, your authentication information is saved to the “session”_. The session is a bucket of information that the Django application saves about your visit — to distingui...

django show query

query

q1 = Fruit.objects.filter(name='apple')
print(q1.query)