hi I want to authenticate user manually how can I keep user signed in, in all applications of project? here's my login view function:
def sign(request):
context = {}
if request.method == 'POST':
form = SigninForm(data = request.POST)
if form.is_valid:
username = request.POST['username']
password = hashlib.sha256(request.POST['password'].encode('utf-8')).hexdigest()
users = customer.objects.all()
for user in users:
if username == user.username:
if password == user.password:
context['tmp'] = "OK"
Aucun commentaire:
Enregistrer un commentaire