Archives du mot-clef : django

Django – Gestion des utilisateurs

Authentification authenticate() from django.contrib.auth import authenticate user = authenticate(username=’john’, password=’secret’) if user is not None: if user.is_active: print "You provided a correct username and password!" else: print "Your account has been disabled!" else: print "Your username and password were incorrect." login() from django.contrib.auth import authenticate, login def my_view(request): username = request.POST['username'] password = request.POST['password'] user