Reputation: 93
I'm fairly new to Django and couldn't figure this one out. I have a HTML page with a form, and once the user clicks submit an external python script is called using celery. I have a view that can check if the celery job is done, but how do I continually poll the database to check if my job is done? Is there a way to "refresh" the view so that it continually polls the job status? I know you can do this in javascript, but I'm not sure how to integrate this with Django (is there some sort of module...)? Any help would be great, thanks!
Upvotes: 3
Views: 7365
Reputation: 184
You can redirect yourself to your own html (https://realpython.com/django-redirects/) On your view.py, after the 'POST' case:
return redirect(request.META['HTTP_REFERER'])
Upvotes: 4