Wants to make webpage auto reload whenever database is update.

943 views
Skip to first unread message

Unnati C

unread,
Nov 25, 2017, 10:55:53 AM11/25/17
to Django users
Web page is about displaying data from database, Till now webpage is displaying data, but if I want to see latest update I have to refresh page in browser. Is their any solution to auto reload page so user at end doesn't have to refresh it.

yingi keme

unread,
Nov 25, 2017, 12:02:51 PM11/25/17
to django...@googlegroups.com
You can use channels. Check out channels in django. It is a websocket library and it will be useful for what you are looking for

Yingi Kem

On 25 Nov 2017, at 4:55 PM, Unnati C <unnat...@gmail.com> wrote:

Web page is about displaying data from database, Till now webpage is displaying data, but if I want to see latest update I have to refresh page in browser. Is their any solution to auto reload page so user at end doesn't have to refresh it.

--
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...@googlegroups.com.
To post to this group, send email to django...@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/a7a12b04-bec0-4d08-aaf9-e7b3b4d6a117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Unnati C

unread,
Nov 26, 2017, 12:20:41 AM11/26/17
to Django users
Thanks for suggestion Yingi Kem, But I am looking for any javascript or any other logical solution to refresh my web page automatically. 

Unnati

shreekant bohra

unread,
Nov 26, 2017, 12:54:39 AM11/26/17
to django...@googlegroups.com
Use this following code to reload page every few seconds as required -

<script type="text/javascript">
    setTimeout(function () { 
      location.reload();
    }, 60 * 1000);
</script>

--
Shree Kant Bohra
Co-founder
Geekybuddha Technologies




To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Jani Tiainen

unread,
Nov 26, 2017, 4:01:43 AM11/26/17
to django...@googlegroups.com
Hi.

You probably could use ajax to poll data and only update visual parts instead of reloading whole page. 

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Unnati C

unread,
Nov 26, 2017, 7:34:28 AM11/26/17
to Django users
I will try this.


On Sunday, November 26, 2017 at 2:31:43 PM UTC+5:30, Jani Tiainen wrote:
Hi.

You probably could use ajax to poll data and only update visual parts instead of reloading whole page. 
26.11.2017 7.21 "Unnati C" <unnat...@gmail.com> kirjoitti:
Thanks for suggestion Yingi Kem, But I am looking for any javascript or any other logical solution to refresh my web page automatically. 

Unnati

On Saturday, November 25, 2017 at 10:32:51 PM UTC+5:30, yingi keme wrote:
You can use channels. Check out channels in django. It is a websocket library and it will be useful for what you are looking for

Yingi Kem

On 25 Nov 2017, at 4:55 PM, Unnati C <unnat...@gmail.com> wrote:

Web page is about displaying data from database, Till now webpage is displaying data, but if I want to see latest update I have to refresh page in browser. Is their any solution to auto reload page so user at end doesn't have to refresh it.

--
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...@googlegroups.com.
To post to this group, send email to django...@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/a7a12b04-bec0-4d08-aaf9-e7b3b4d6a117%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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Unnati C

unread,
Nov 26, 2017, 7:39:34 AM11/26/17
to Django users
it's working, Thanks...

Saurabh Pandey

unread,
Sep 19, 2020, 10:19:54 PM9/19/20
to Django users
hi Unnati can u help how it worked. i have same issue where i need to restart server to get latest data otherwise it is not updating fresh data.

Unnati C

unread,
Sep 19, 2020, 11:42:29 PM9/19/20
to Django users

Hello Saurabh, 
Before 3 years I solved my problem using Ajax and Javascript. If you know some front end coding try to fetch the updated data from backend database. 
Don't try to push it from backend to front end. Hope you get your answer. 
Reply all
Reply to author
Forward
0 new messages