[Django #12] Adding user authentication
This commit is contained in:
parent
5cd127f2c1
commit
c2a3e1cf62
1 changed files with 3 additions and 1 deletions
|
@ -157,7 +157,9 @@ def login(request):
|
||||||
login_form = AuthenticationForm(request, request.POST)
|
login_form = AuthenticationForm(request, request.POST)
|
||||||
if login_form.is_valid():
|
if login_form.is_valid():
|
||||||
auth_login(request, login_form.get_user())
|
auth_login(request, login_form.get_user())
|
||||||
return redirect('newrandomIP')
|
return redirect('newrandomIP')
|
||||||
|
else:
|
||||||
|
print("fail login")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
login_form = AuthenticationForm()
|
login_form = AuthenticationForm()
|
||||||
|
|
Loading…
Reference in a new issue