django project avoid reload page where work algorithm

Michael Torrie torriem at gmail.com
Sun Oct 8 17:41:32 EDT 2017


On 10/08/2017 02:46 PM, Xristos Xristoou wrote:
> Τη Κυριακή, 8 Οκτωβρίου 2017 - 10:48:38 μ.μ. UTC+3, ο χρήστης Richard Damon έγραψε:
>> It sounds like the fundamental problem is that you are doing the 
>> calculation in the web page handler. This means that the browser will be 
>> stuck in the page load until the calculation finishes, and that if the 
>> user aborts the access (or loses connection) then the web page handler 
>> is aborted.
>>
>> What you need to do is rather than doing the calculation in the page 
>> handler, you need to kick off an independent process to do the 
>> calculation, and then immediately finish the page (maybe giving the use 
>> a link to a page they can check to see if a result is available).
> 
> yes this is nice can you help me to do that?

I'm sure google can give you some ideas on how to implement this.  Have
you done a google search? Maybe start with the terms "django
long-running process" and see what comes up. Good luck.  Learning is a
fun adventure!



More information about the Python-list mailing list