How do I find the previous URL that referred to the current one in Django?
For example, I want different output from my home page if it was referred from the login page or from the sign up page or from elsewhere?
I can see what I want in the Referer section of Request Headers in Chrome Developer Tools, but I can't seem to access the value using request.referer
.
I don't want to append the referer using index.html?return_url={{ request.path }}
because I'm not certain where it's coming from.