Home:ALL Converter>How To Add Session Variables with Built-In login view

How To Add Session Variables with Built-In login view

Ask Time:2018-05-26T00:50:29         Author:Talha Ahmed

Json Formatter

I used the built-in login view that django makes but now I don't know how to set sessions when a user logs in. I was thinking of redirecting a user to a new view that would add these session variables but I don't see that as an ideal fix. Another question I have is: Can I use these session variables in my templates? If not, how would I get that data to the templates?

Also I am using Django 1.11 with python 2.7.

Author:Talha Ahmed,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50533727/how-to-add-session-variables-with-built-in-login-view
yy