'how to set loader in django app using python and javascript

I'm building a big project using django, and I want the best way to put the loader during operations

for Example:

code

now this function need almost 2 min to finsh

the function

when this function run the page only loading

how i can set a loader while the function run ?

for frontend i use (html , css, js) backend ( django - python )

i want simple method

In short, I want to set loader while the run functions in django :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source