I have two page that the user needs to be logged in to access, both of them redirect to the login URL with the @login_required decorator
@login_required
def ask_question(request)
@login_required
def answer_question(request)
and I would like to display a message on the login page that will be specific depending on the page that redirected to the login.
Both pages have a link on the same page, on the index page so I can't use the request origin because the two have the same origin.
Like:
"You need to be logged in to ask question" (if the user came from the ask question redirection)
"You need to be logged in to answer question" (if the user came from the answer redirection)