I am looking for the most efficient way that I can present on a live web page data such as a table with data from the database, that when a new record is added to the database the table updates itself without the user having to refresh the page.
I have tried the method with Django and Ajax but I don't find it efficient because it has to refresh at a certain time but I only want it to refresh when a new record is added to the database.
What methods could you recommend?
CodePudding user response:
With standard Ajax, the client has to initiate the request. If you want the server to be able to "push" to the client without a request from the client, you'll want to use websockets. There's a package called Django Channels for implementing websockets in Django.