Django and asynchronous tasks

2016-11-10 Thread Alain Muls
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

Re: Django and asynchronous tasks

2016-11-10 Thread Daniel Chimeno
Hello, One simple approach is to persist the calculations in the database, then you can use a view to display them in another page. Hope it helps. El jueves, 10 de noviembre de 2016, 9:05:29 (UTC+1), Alain Muls escribió: > > Hi All > > I am building a website which makes calculations about the

Re: Django and asynchronous tasks

2016-11-10 Thread Antonis Christofides
(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 aja

Re: Django and asynchronous tasks

2016-11-10 Thread Alain Muls
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

Re: Django and asynchronous tasks

2016-11-10 Thread Alain Muls
Hi What does 'persist the solution in a database' means and how can I react on it? bye/alain On Thursday, 10 November 2016 09:35:06 UTC+1, Daniel Chimeno wrote: > > Hello, > One simple approach is to persist the calculations in the database, then > you can use a view to display them in anothe

Re: Django and asynchronous tasks

2016-11-10 Thread Antonis Christofides
> 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 mechan

Re: Django and asynchronous tasks

2016-11-10 Thread ludovic coues
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/sta

Re: Django and asynchronous tasks

2016-11-29 Thread Alain Muls
Hi All I spent several days reading and searching examples of how to implement channels. The current status of my project is as follows: - I have a page which lets the user enter the data used for the offline calculations, a POST request is send - the post request is handled and I can

Re: Django and asynchronous tasks

2016-11-30 Thread Andrew Godwin
Hi Alain, I'm not quite sure what you're trying to accomplish by mixing rq and channels; Channels just allows you to either write things against WebSocket connections, or to build your own eventing system from scratch on the same base code. If you're trying to return results to a webpage, you'll

Re: Django and asynchronous tasks

2018-08-30 Thread Karim
On Thu, Nov 10, 2016 at 7:05 PM Alain Muls wrote: > Hi All > [...] > I found celery very hard to work with. I liked a lot ` https://django-q.readthedocs.io/`. Give it a go. -- Karim N. Gorjux -- You received this message because you are subscribed to the Google Groups "Django users" group.