In Django if a request is made to another module. Can we know where the request has made from through the request variable…
In the below example I have to know that the request was made from a.html ort that corresponding module
Ex:
a.html
<html>
<form onsubmit=/b>
</form>
</html>
In your view code you can do something like this:
Note that you probably want to avoid hard-coding URLs in your view code (as I’ve done above for the sake of simplicity, you probably want to use
reverse().