Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send message to a client withoud receiving a client request #632

Closed
frankl1 opened this issue May 10, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@frankl1
Copy link

commented May 10, 2017

Hello,

The tutorial show how to manage websocket, that pretty good. But what I really want now is to send message to client without receiving any request when the websocket connection have been established.
Suppose I want to notify a specific user about an event, How can I achieve that ?

Thanks !

@jeremytiki

This comment has been minimized.

Copy link
Contributor

commented May 10, 2017

@frankl1 The Channels Examples project provides a great example of how to do this: https://github.com/andrewgodwin/channels-examples/tree/master/liveblog

Specifically for this example, a blog is created, and the save method is modified to add a new call to the method send_notification that sends out a channel or group reply.
Additionally you could also accomplish the same thing with Django's signals framework

@frankl1

This comment has been minimized.

Copy link
Author

commented May 10, 2017

Thank's, clear and simple.
It worked perfectly.

@frankl1 frankl1 closed this May 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.