Saturday, November 25, 2017

Re: How can I learn to make a user login?

On Saturday, 25 November 2017 18:57:04 UTC, Tom Tanner wrote:
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?


Why do you think you need a "backend"? You've got everything you need here already. 
--
DR.

--
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/6c760288-d5ad-466b-8963-792b8d631f35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment