1๐
โ
Iโm preety sure a combination of JQuery and AJAX can do the trick.
See: Update data on a page without refreshing
and How to update data on field on a website from SQL database with AJAX and Django.
I think the best example is in this SO question: setInterval and Ajax
Perhaps the following code snippet can be useful for you, which is supposed to be added in the html template.
<script type="text/javascript">
$(function() {
function callAjax(params, title, url){
$.ajax({
#<<<here you build the request, the html-POST>>>
}
});
};
function regularCall() {
callAjax("", "", "{% url 'the-url-that-you-expect-from-django-side' %}");
};
setInterval(regularCall, 10000); // Time in milliseconds
callAjax("", "", "{% 'the-url-that-you-expect-from-django-side' %}"); // First Call
});
</script>
๐คeguaio
Source:stackexchange.com