title: Django, websockets, Tornado, how to make them communicate?
body: <p>So I read that the best option at the moment to implement websockets with Django is to use Tornado to run a websocket server.</p>
  
  <p>Ok I get that.</p>
  
  <p>But suppose I want to broadcast messages through the websocket server whenever something happens in my django app, for example: a device of the network suddenly goes offline, I want the network administrator to get notified istantly.</p>
  
  <p>The natural process I can think of is to register a signal to the device model and whenever something interesting happen I must be able to tell Tornado: hey buddy, send a message in broadcast to all the admins connected.</p>
  
  <p>But how would I do that?</p>
  
  <p>Maybe with some kind of publish/subscribe mechanism? Celery? </p>
  
  <p>Are there any articles about this stuff? It's pretty interesting but could not have found any real use cases explained properly yet.</p>
  
  <p>Thanks!</p>
  
  <h2>Edit: a working prototype</h2>
  
  <p>After following the suggestion in the accepted answer i've come up with this:
  <a href="https://github.com/ninuxorg/nodeshot/commit/26373a3478d77a8cc8ac8bbd0c1c45694c26a779" rel="nofollow">https://github.com/ninuxorg/nodeshot/commit/26373a3478d77a8cc8ac8bbd0c1c45694c26a779</a></p>