Saturday, November 25, 2017

How can I learn to make a user login?

I've read this tutorial on making a simple user registration form. But what about a form for just logging in existing users? I can make a registration form with `views.py` looking like this:

 registration_form.save()
 email
= registration_form.cleaned_data.get("email")
 raw_password
= registration_form.cleaned_data.get("password1")
 user
= authenticate(username=email, password=raw_password)
 login
(request, user)
 
return redirect(home_slug())

Is there an example of how to make the backend for logging in users?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a99e8479-2a7a-4c64-b6bf-8c3f1e0d025f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment