Django Real time Notifications

278 views
Skip to first unread message

yingi keme

unread,
Jun 11, 2017, 8:00:20 AM6/11/17
to Django users
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?

Andréas Kühne

unread,
Jun 11, 2017, 8:09:01 AM6/11/17
to django...@googlegroups.com
Hi,

You should check out django-channels (https://channels.readthedocs.io/en/stable/) for that. That is a websocket based solution for doing realtime notifications (as long as the users are logged in to the website).

Regards,

Andréas


--
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+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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f67beae9-a58b-40ec-8ecf-9181f617b089%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Melvyn Sopacua

unread,
Jun 11, 2017, 8:19:27 AM6/11/17
to django...@googlegroups.com

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

yingi keme

unread,
Jun 11, 2017, 9:28:11 AM6/11/17
to django...@googlegroups.com
Thanks Andreas. I will check it out

Yingi Kem
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.

yingi keme

unread,
Jun 11, 2017, 9:28:41 AM6/11/17
to django...@googlegroups.com
Thanks melvyn. I think you nailed it for me.

Thanks again

Yingi Kem
--
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.
Reply all
Reply to author
Forward
0 new messages