Reload flask current page - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Reload flask current page (/thread-31886.html) |
Reload flask current page - GrahamL - Jan-08-2021 Hi I am developing a Flask app that communicates with a back end via pipes. I need to reload the current page of the Flask app when an update is received from the back end, but cannot see how to do this. Is there a way of forcing a refresh of the current page? RE: Reload flask current page - kashcode - Jan-08-2021 I suggest reload some page parts with ajax call to backed, this call to backed can be with some interval. function fetchdata(){ $.ajax({ url: 'fetch_details.php', type: 'post', success: function(response){ // Perform operation on the return value alert(response); } }); } $(document).ready(function(){ setTimeout(fetchdata,5000); }); RE: Reload flask current page - GrahamL - Jan-08-2021 (Jan-08-2021, 08:19 AM)kashcode Wrote: I suggest reload some page parts with ajax call to backed, this call to backed can be with some interval. Thanks for the response However, I'm not sure what you are getting at. I do not need to refresh at an interval but when I get pipe input from a separate program. In the Flask app the user presses a button which results in a message being sent via a pipe to a separate program. When this other program receives the message it performs some processing and writes a response to the pipe and this is then received by the Flask app. When the Flask app receives the reply I want to reload a page in the Flask app. |