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
Another thing you could do is add a javascript function that displays a loading image before it actually calls the Django View.
function showLoaderOnClick(url) {
showLoader();
window.location=url;
}
function showLoader(){
$('body').append('Loading...');
}
And then in your template you can do:
This will take some time...
Here's a quick default loadingDiv : https://stackoverflow.com/a/41730965/13476073 Note that this requires jQuery.