I need your help, In my view i run a bash process that takes time depending on the size of the image; while it process i want to display a loading gif image and a sentence (such as "Please wait, the image is being processed"). I tried to did that with a template but it is rendered at the end of execution of the script not while it process. Can someone help me to do that ? I've found a similar question "https://stackoverflow.com/questions/8317219/django-show-loading-message-during-long-processing" but the answer wasn't very clear for me because i never used ajax.
This is my view :
def process(request):
var = Image.objects.order_by('id').last()
subprocess.call("./step1.sh %s" % (str(var)), shell=True)
subprocess.call("./step2.sh %s" % (str(var)), shell=True)
return render(request, 'endexecut.html')
Template that will be displayed at the end of processing: "endexecut.html"
{% extends 'base.html' %}
{% block content %}
<div class="container">
<div class="row">
<div class="jumbotron">
<div class="row">
<center>
<p> Your image is processed succesfully ! </p>
</center>
</div>
</div>
</div>
</div>
{% endblock %}