On Sunday 11 June 2017 05:00:19 yingi keme wrote:
> I want to know if django supports any real time
> notifications/communications in web applications.
> 
> For instance, if User A makes an update to its model instance, User B
> should get an instant notification in real time.
> 
> Does django provide a mechanism for that?

Yes and no.
Django allows you to define signals, one of them being a post_save signal on a 
Model.
It has no mechanism to notify "User B", as it does not know how to notify User 
B.

But, it has views and urls and browsers have Ajax. So you can poll (not 
realtime).

Django Channels (which is a 3rd party package created by one of Django's core 
developers) 
supports websockets. Using websockets one can notify in (near) real time.

So in order to do what you want, you need to glue signals to channels, or teach 
Django 
Channels how to detect a change in your model.
-- 
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/1912475.GSAzsYGyPs%40devstation.
For more options, visit https://groups.google.com/d/optout.

Reply via email to