示例#1
0
def login(request):
    """
    Login the user and redirect him to the homepage

    :Rest Types: ``GET``
    :URL: ``^login/$``
    """
    if request.user.is_active:
        return HttpResponseRedirect('/')
    else:
        return base_login(request)
示例#2
0
def login_view(request):
    return base_login(request, authentication_form=AuthenticationForm)
示例#3
0
def login_view(request):
    return base_login(request, authentication_form=AuthenticationForm)
示例#4
0
def custom_login(request):
    if is_ip_banned(request):
        messages.error(request, "Your account was disabled.")
        return redirect('home')
    else:
        return base_login(request)
示例#5
0
def custom_login(request):
	if is_ip_banned(request):
		messages.error(request, "Your account was disabled.")
		return redirect('home')
	else:
		return base_login(request)