I am using Django 1.9. Base on the Django documentation:
" To log a user in, from a view, use login(). It takes an HttpRequest object and a User object. login() saves the user’s ID in the session, using Django’s session framework."
So how do I retrieve the information in that session.
For example: (this is also taken from the documentation)
from django.contrib.auth import authenticate, login
def my_view(request):
username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username, password=password) if user is not None: if user.is_active: **login(request, user)** # Redirect to a success page. else: How do I retrieve the user information such as username or if possible the password out on the success page.
P.S If you could also kinda explain the solution in layman term as possible
EDIT I was playing around with the framework back then. So I was testing if it can be done.