Re: Implementing a 'please wait' page

2018-06-01 Thread Melvyn Sopacua
On vrijdag 1 juni 2018 01:35:36 CEST Mohammed Noor wrote:

> I want to be able to display a page saying 'please wait for  taken to complete process>'  after submit button is clicked. Can you please
> give me any ideas on how to implement this.

As said by others, celery is one way to do this and this tutorial shows all 
things required to provide user feedback:

https://buildwithdjango.com/blog/post/celery-progress-bars/

-- 
Melvyn Sopacua

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/2601912.fUvbL4GUKq%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-06-01 Thread Larry Martell
On Thu, May 31, 2018 at 7:35 PM, Mohammed Noor  wrote:
> Hello Guys,
>
> I currently have a process running on my django application which takes about 
> 10-15 minutes to complete.
>
> Currently, the user clicks on a 'submit' button and this process starts. The 
> web page remains in a hung state for the complete time this process takes to 
> run and after say 10-15 mins another 'results' page is displayed.
>
>
> I want to be able to display a page saying 'please wait for  taken to complete process>'  after submit button is clicked. Can you please 
> give me any ideas on how to implement this.

The way I have dealt wth this is to define something in the template like this:

 ... loading images 
$('.loadMsg').show();

And then in window.onload function:

$('.loadMsg').hide();

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CACwCsY7NxXWWqLS6KSbeiB%2BXUd8iA3ZbErOsyOoP2CwejYpTPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-06-01 Thread Mohammed Noor
Wow. Yeah. That scenario of 100 users hitting together...honestly, I haven't 
thought much about it. Would using celery help me overcome this problem? 

> On 01-Jun-2018, at 4:33 PM, Jason  wrote:
> 
> you can with celery, just make a view that checks the task ID of the task and 
> if its PENDING, return 'waiting', which would be used by your browser.
> 
> also consider the fact that servers will require you to specifically override 
> the connection timeout setting.  with finite numbers of connections the 
> server has, imagine if 100 users hit your server for tasks and have to wait 
> 15 minutes.  your original method won't scale at all beyond a handful of 
> users.
> -- 
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/a087bbd2-bde4-4740-838a-e7d870dcf6e1%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/147E8DE4-BA93-466E-BB1A-AF022A4225E1%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-06-01 Thread Jason
you can with celery, just make a view that checks the task ID of the task 
and if its PENDING, return 'waiting', which would be used by your browser.

also consider the fact that servers will require you to specifically 
override the connection timeout setting.  with finite numbers of 
connections the server has, imagine if 100 users hit your server for tasks 
and have to wait 15 minutes.  your original method won't scale at all 
beyond a handful of users.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/a087bbd2-bde4-4740-838a-e7d870dcf6e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-06-01 Thread Mohammed Noor
Thanks Mark! I will surely have a look at them.

But I was hoping if there was a way of getting this done using ajax or
jquery.

Mohammed Noor

On Fri, Jun 1, 2018 at 11:55 AM, Mark Phillips 
wrote:

> Have you looked at celery (http://www.celeryproject.org/) to handle the
> long running process? Perhaps in conjunction with redis (https://redis.io/
> )?
>
> If you passed the long running process to celery, then you could change
> the page to "say please wait".
>
> Mark
>
> On Thu, May 31, 2018 at 4:35 PM, Mohammed Noor  wrote:
>
>> Hello Guys,
>>
>> I currently have a process running on my django application which takes
>> about 10-15 minutes to complete.
>>
>> Currently, the user clicks on a 'submit' button and this process starts.
>> The web page remains in a hung state for the complete time this process
>> takes to run and after say 10-15 mins another 'results' page is displayed.
>>
>>
>> I want to be able to display a page saying 'please wait for > time taken to complete process>'  after submit button is clicked. Can you
>> please give me any ideas on how to implement this.
>>
>>
>> Here is a rough representation of my code flow:
>>
>> Main function ():
>> -lots of code
>> -call to sub function() //this is the guy taking 10-15 mins to execute
>> -if sub function() returns true then proceed else break and exit.
>>  -remaining code of Main function()
>>
>> As you might have guessed, I want to be able to change the display when
>> this sub function () is hit. Btw, main function () is executed when user
>> clicks on submit button.
>>
>>
>> Appreciate your help!
>>
>> Thanks and Have a great day,
>> Mohammed Noor
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/5CF991C0-FB63-47BA-9A2A-47224E468D0B%40gmail.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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/CAEqej2OTHwsOe5svxqbd31h1NSniROe9pnmbDm%2BN3vPGtUPTSw%
> 40mail.gmail.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CABANScQyp9rDr8sD8Gxf-y%2BFJ1RawBOAZuRNJ9LPwfUToWw%3DOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Implementing a 'please wait' page

2018-05-31 Thread Mark Phillips
Have you looked at celery (http://www.celeryproject.org/) to handle the
long running process? Perhaps in conjunction with redis (https://redis.io/)?

If you passed the long running process to celery, then you could change the
page to "say please wait".

Mark

On Thu, May 31, 2018 at 4:35 PM, Mohammed Noor  wrote:

> Hello Guys,
>
> I currently have a process running on my django application which takes
> about 10-15 minutes to complete.
>
> Currently, the user clicks on a 'submit' button and this process starts.
> The web page remains in a hung state for the complete time this process
> takes to run and after say 10-15 mins another 'results' page is displayed.
>
>
> I want to be able to display a page saying 'please wait for  time taken to complete process>'  after submit button is clicked. Can you
> please give me any ideas on how to implement this.
>
>
> Here is a rough representation of my code flow:
>
> Main function ():
> -lots of code
> -call to sub function() //this is the guy taking 10-15 mins to execute
> -if sub function() returns true then proceed else break and exit.
>  -remaining code of Main function()
>
> As you might have guessed, I want to be able to change the display when
> this sub function () is hit. Btw, main function () is executed when user
> clicks on submit button.
>
>
> Appreciate your help!
>
> Thanks and Have a great day,
> Mohammed Noor
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/5CF991C0-FB63-47BA-9A2A-47224E468D0B%40gmail.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAEqej2OTHwsOe5svxqbd31h1NSniROe9pnmbDm%2BN3vPGtUPTSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Implementing a 'please wait' page

2018-05-31 Thread Mohammed Noor
Hello Guys,

I currently have a process running on my django application which takes about 
10-15 minutes to complete. 

Currently, the user clicks on a 'submit' button and this process starts. The 
web page remains in a hung state for the complete time this process takes to 
run and after say 10-15 mins another 'results' page is displayed. 


I want to be able to display a page saying 'please wait for '  after submit button is clicked. Can you please 
give me any ideas on how to implement this. 


Here is a rough representation of my code flow: 

Main function (): 
-lots of code
-call to sub function() //this is the guy taking 10-15 mins to execute
-if sub function() returns true then proceed else break and exit. 
 -remaining code of Main function()

As you might have guessed, I want to be able to change the display when this 
sub function () is hit. Btw, main function () is executed when user clicks on 
submit button. 


Appreciate your help! 

Thanks and Have a great day,
Mohammed Noor

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/5CF991C0-FB63-47BA-9A2A-47224E468D0B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.