def login_request(request):
    context = {}
    if (request.method == 'POST'):
        username = request.POST['username']
        password = request.POST['psw']
        user = authenticate(username=username, password=password)
        if (user is not None):
            login(request, user)
            return redirect('onlinecourse:index')
        else:
            context['message'] = 'Invalid username or password.'
            return render(request, 'onlinecourse/user_login_bootstrap.html', context)
    else:
        return render(request, 'onlinecourse/user_login_bootstrap.html', context)
def login_request(request):
    context = {}
    if (request.method == 'POST'):
        username = request.POST['username']
        password = request.POST['psw']
        user = authenticate(username=username, password=password)
        if (user is not None):
            login(request, user)
            return redirect('onlinecourse:index')
        else:
            context['message'] = 'Invalid username or password.'
            return render(request, 'onlinecourse/user_login_bootstrap.html', context)
    else:
        return render(request, 'onlinecourse/user_login_bootstrap.html', context)