i am building a custom login app with django and postgres, i wrote a login_view when django tries to login in to da db it crash :
@csrf_protect
def logins(request):
{csrf_token}
if request.method == ‘POST’:
info = UserInfo()
username = request.POST[‘username’]
password = request.POST[‘password’]
user = auth.authenticate(username=username, password=password)
if user is not None:
info.user_name = username
auth.login(request, user) # i get blocked here
if request.user.is_superuser:
info.user_role = True
return render(request, “dashboard.html”, {‘info’: info})
else:
return render(request, “dashboard.html”, {‘info’: info})
else:
return redirect(’/’)
else:
return redirect(’/’)
but when i write into the search bar of the browser : http://127.0.0.1:8000/admin/ , it take me to the default dashboard admin of django, so i dont understand why my custom login page dont work