Answer the question
In order to leave comments, you need to log in
Why is the user authorization in django not going through?
Hello.
I want to login random users -
if request.user.is_anonymous():
usertag = random.randint(10000, 99999)
username = "visitor"+str(usertag)
password = "Visitor"+str(usertag)
email = username + '@' + str(usertag) + '.ru'
user_obj=User(username=username, password=password, email=email)
user_obj.save()
user = auth.authenticate(username=user_obj.username, password=user_obj.password)
auth.login(request, user)
current_user = request.user
if request.POST:
so on...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question