L
L
lockdog2020-07-22 00:25:54
Django
lockdog, 2020-07-22 00:25:54

How to update the data on the page when adding an entry to the database in Django+Channels?

Good afternoon,
In general, I'm a little dumb and I ask for the help of the community. In general, I understand Django quite well and write an application for my project. But you need to add interactivity and update the data on the page when a new entry is added to the database. I started trying Django Channels, read the office. tutorial and started the chat from the example. But I can’t understand at all how to force an element to be updated on the page if new data has arrived in the database. Need to run some kind of background task that will check the database? Or in consumer it is necessary to process somehow? Please help. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
szelga, 2020-07-22
@szelga

hang handlers on the necessary signals, for example, and when updating, shove the data into the appropriate channels.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question