Wednesday, March 1, 2017

Re: Djnago User login

It takes a little fiddling, but you can log in a user however you want.


In short, you can call django.contrib.auth.login(request, user) and force a login without any authentication if you really wanted to. Given that, you can make your own auth backend (subclass the default one) that returns True for certain usernames without checking the value of the password field.


--
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/CAOzwKwGNmQ9XL6T0Btm%3DhS0iXOasw17YPzZbsgngcRqgSU4b%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment