Use of Django login_required decorator, how can I resume my paused view after the login succeeded?

As the title mentioned and please refer to code below. When the user is going to my_view_1 page, he will firstly be redirected to /login for a page of (user/password) input. The view function loginSub will get the user's submit and check. I didn't know how to go back to my_view_1 view after the authentication is met.

@login_required(login_url='/login')
def my_view_1(request ):
    #do sth
    return displaySomething(request)

def login(request):
    context = {}
    #input username and password
    return render(request, "logpage.html", context)

def loginSub(request):
    #check password
    return my_view_1(request)
Back to Top