Informing the client on the page

Ajax allows you to access the server, get a response, and render without refreshing the page. Whether it is possible to send data from the server to the page without a request from ajax. For example, the client sent a file, the site displays information about the processing stage , and then about readiness. How to implement this in django? Sorry if I phrased the question badly .

Can’t be done without JavaScript in the browser. When you request a web page, that connection to the server only lives as long as it takes for the server to return that page. Any other data transmissions after that require the browser take some action to open another connection.

Having said that, there is a Django package called Channels that can help integrate Django with a persistent connection environment.

1 Like