How can I show a please wait loading message from a django view?
I have a Django view that takes significant time to perform calculations on a large dataset
A workaround that I chose was to use beforunload and unload events to show the loading image. This can be used with or without window.load. In my case, it's the view that is taking a great amount of time and not the page loading, hence I not using window.load.
The downside is that there is a false message that goes out to the user that the page is loading even when when the request has not even reached the server or it's taking much time. And if, for some reason, the request dies out, the user continues to think that the page is loading, and loading. But I'm living with this for now.
P.S. I cannot comment yet hence posted this as an answer.