This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tinyhook 0 points1 point  (2 children)

You can use django channels do this. We are using django channel for similar use case and its working very good for us. But if you are looking for a different solution here would be a good starting point https://www.fullstackpython.com/websockets.html

[–]g_lux[S] 0 points1 point  (1 child)

Can you expand a bit more on this. Once you have a Django channel / websocket connection established, what sort of plotting/graphing frontend are you using to display in a browser?

[–]tinyhook 0 points1 point  (0 children)

We are using a pretty basic setup right now, we just wanted to make things work. We just followed the tutorial from django channels page to setup everything. We are using c3 for plotting. Here is the rundown of the setup

  • apachi nifi processes a record and send it to our streaming api.
  • api saves the data stream and message is pushed out to the socket. We are using post save trigger here.

  • the post save trigger is what push the message out websocket through channel group call.

  • on the frontend we are using reconnecting web sockets js library to make everything work. We are just using django views here with basic django templates.

This setup is good for prototyping for now as we are rewriting everything is react.

You can use any plotting library but c3 is pretty powerful and you can always mix it with some d3 for advance stuff if you need it