Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Login account
- def login_view(request):
- if request.method == 'POST':
- form= UserLoginForm(request.POST)
- if form.is_valid():
- username=form.cleaned_data['username']
- password=form.cleaned_data['password']
- user = authenticate(username=username,password=password)
- if user is not None:
- if user.is_active:
- login(request,user)
- return rederict('gbiz1990:businesshub')
- else:
- print("invalid login details" + username +""+password)
- form=UserLoginForm()
- return render(request,'gbiz1990/user_account/login.html',{'form':form})
- else:
- form=UserLoginForm()
- return render(request,'gbiz1990/user_account/login.html',{'form':form})
Add Comment
Please, Sign In to add comment