you can use django async for realtime data On Wed, Jan 6, 2021 at 3:39 AM degnon...@gmail.com <degnonfran...@gmail.com> wrote:
> Hello, > > I am building a very simple website in which the main page allows users to > import their contacts via csv or excel files to a postgres database. > > I have a page that displays whether or not the import of contacts is > finished, I need my frontend to update automatically as soon as the task is > finished in the background, basically when the data is fully imported into > the database. > I'm thinking of looking for a way to refresh the page every 5 second or > something like that, but I don't think this is a good idea. > I am not quite sure how to approach this. I still have some learning to > do, but I need some guidance on what approach to take. I am thinking I will > need to use JQuery/Ajax? So write my HTML template and then link it to a > Javascript script that does the refresh? > > I think I can figure out how to refresh the page, but how do I have the > model queried, view called, and new data fed to the HTML template each time > the page auto-refreshes? > > I am also not sure if web sockets are what I need. If ajax is not the > answer here, an example of scenario where ajax is useful would be really > helpful, I always hear about it but I don't know when it can be useful. > > Any help or link to resources is immensely appreciated!! > > Thank you. > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/5560f982-adc8-4498-9dbf-ddd7677d6a51n%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/5560f982-adc8-4498-9dbf-ddd7677d6a51n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJepfJUNiRdww2b1Q0BCE7zmK3Gg4Nk%2BSQv9vpvjS8vc6%2BLBgw%40mail.gmail.com.