简体   繁体   English

使用Django实时显示数据

[英]Display Data In Real Time With Django

I have a simulator application that continuously spits out data, formatted in JSON, to a given host name and port number (UDP). 我有一个模拟器应用程序,它连续地将以JSON格式化的数据吐出到给定的主机名和端口号(UDP)。 I would like to be able to point the simulator output to a Django web application so that I can monitor/process the data as it comes in. 我希望能够将模拟器输出指向Django Web应用程序,以便我可以监视/处理数据。

How do I receive and process data in real time using Django? 如何使用Django实时接收和处理数据? What tools or packages are available to accomplish this? 有哪些工具或软件包可以实现此目的? I did come across this answer: How to serve data from UDP stream over HTTP in Python? 我确实遇到过这样的答案: 如何在Python中通过HTTP提供来自UDP流的数据? , but I don't completely understand. ,但我不完全明白。

Ex: Similar to this page: http://money.cnn.com/data/markets/ 例如:与此页面类似: http//money.cnn.com/data/markets/

ALSO, I don't need to store any of the streaming data in a database. 另外,我不需要将任何流数据存储在数据库中。 I just need to perform lookups based on the streaming data. 我只需要根据流数据执行查找。 Maybe it's not a Django issue at all? 也许这根本不是Django的问题?

Using Javascript. 使用Javascript。 Create a webpage with all the results, and then use javascript to collect the data from the page, and update it every X seconds. 创建包含所有结果的网页,然后使用javascript从页面收集数据,并每隔X秒更新一次。

Have the webpage be the JSON data, and the javascript grab it an interpret it. 让网页成为JSON数据,javascript抓住它解释它。 get html code using javascript with a url 使用带有网址的javascript获取HTML代码

Then update the page using javascript. 然后使用javascript更新页面。 ww3 schools has great JS tutorials ww3学校有很棒的JS教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM