Django - show loading message during long processing

前端 未结 7 1421
野的像风
野的像风 2020-12-03 03:54

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

7条回答
  •  离开以前
    2020-12-03 04:10

    a more straightforward approach is to generate a wait page with your gif etc. and then use the javascript

    window.location.href = 'insert results view here';
    

    to switch to the results view which starts your lengthy calculation. The page wont change until the calculation is finished. When it finishes, then the results page will be rendered.

提交回复
热议问题