Django - how to tell if user was redirected to the page by @login_required?
问题 I want to use the @login_required decorator for a view called allUsers_page , which is used when you go to the url r'^users/allUsers$' In my settings.py, I have LOGIN_URL='/login' so when a user goes to the allUser_page view (when he goes to the url users/allUsers , if the user is not signed into his account, it will redirect him to the login page. Now, in the login page, is there a way for me to find out if the user just went to the login page directly or if he was redirected to the login