ygnim
0
Q:

django authenticate

from django.contrib.auth import authenticate, login
1
from django.contrib.auth import authenticate, login

def my_view(request):
    username = request.POST['username']
    password = request.POST['password']
    user = authenticate(request, username=username, password=password)
    if user is not None:
        login(request, user)
        # Redirect to a success page.
        ...
    else:
        # Return an 'invalid login' error message.
        ...
4
from django.contrib.auth import authenticate
0

New to Communities?

Join the community