Websocket provide a way for server to send information to the client without waiting for input from the client.
Django channels [1] is a project to bring native support of websocket to django. There are alternatives which might involve a bit more of work [1] https://channels.readthedocs.io/en/stable/ 2016-11-10 11:38 GMT+01:00 Antonis Christofides <[email protected]>: > Is there no mechanism that when the background tasks finishes to have a web > page called which could display the results? > > Web pages cannot be "called". They are loaded by the browser. So, what you > want is a mechanism that notifies the browser that an event has occurred in > the server. That mechanism is comet. > > Antonis Christofides > http://djangodeployment.com > > On 2016-11-10 11:54, Alain Muls wrote: > > Hi > > Tx for the suggestion but how do I reload a page after eg 30 seconds? > Is there no mechanism that when the background tasks finishes to have a web > page called which could display the results? > I had a look at the signal mechanism of Django but I think that is not > working since the background task is in another environment than the django > apps which called it. > > bye/alain > > On Thursday, 10 November 2016 09:55:08 UTC+1, Antonis Christofides wrote: >> >> (Note: The most popular way to do asynchronous tasks is celery, but indeed >> some >> people prefer django-rq, which is said to be simpler. But your question is >> not >> affected by that.) >> >> I'm not an expert but I think that the "correct" way to do what you want >> would >> be to use comet (i.e. the opposite of ajax). However, if the work required >> to >> make that work is not justified by the budget or the business case, you >> might be >> able to get away with a message like "This information is being >> (re)calculated. >> Reload the page after half a minute to view the updated results." (That's >> what I >> did last time :-) >> >> Regards, >> >> Antonis >> >> http://djangodeployment.com >> >> On 2016-11-10 10:04, Alain Muls wrote: >> > Hi All >> > >> > I am building a website which makes calculations about the visibility of >> > satellites. These calculations take about half a minute so I do not want >> > to >> > block the site during this time. I found django-rq and was able to start >> > a >> > asynchronous task which handles the calculations. >> > >> > The problem I have is how do I find out when the calculations of the >> > task >> > thread are done so that I can direct the results to another web page >> > which >> > will display them? >> > >> > Thanks for your help >> > >> > Alain Muls >> > >> > >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/6ae68ef3-6a52-4a59-a87b-3fcd627b4f26%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/0dcd7af0-6833-8174-363a-a68c5b3ff5c9%40djangodeployment.com. > > For more options, visit https://groups.google.com/d/optout. -- Cordialement, Coues Ludovic +336 148 743 42 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTb1TmUtwaYV_Q7A70o_0OWyQd9S1m4CKqZ_4unGtFQWQg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

