Django Real time chart when database was updated by MQTT

my Django server receive data from device over MQTT sucessfully and store these data in database

def on_message(mqtt_client, userdata, msg):
    from lorawan_api.server_processing import SERVER_PROCESSING
    print(f'Received message on topic: {msg.topic}') # with payload: {msg.payload}')
    data_processing = SERVER_PROCESSING()
    data_processing.data_stored(msg.topic,msg.payload)

Now i want to display them in real time chart. I found some solution using AsyncWebsocketConsumer. Is that the best way to display real time chart

Back to Top