Forums

My csv file doesn't get reloaded once I update the data in it from my webapp

I have a function in my app.py file, that adds data to the tracker.csv file, and there is another function that displays all the values inside the tracker.csv file. but it doesn't get updated and nothing is displayed and If I go to the Web section and hit the 'reload' button the output is displayed.

Please help me to fix this

Where and when are you calling those functions? If the data is updated only once when you reload the web app, it probably means that you call those functions while loading the app.

Yes right, is there a fix for it?

Sure, you should manage such behaviour with different views/requests. There are lots of ways to handle this -- the general rule would be that when a particular request is sent by user, function fetching data is called and the data is presented to the user; when user sends another request, the data is updated by calling the second function. Take a look at this tutorial, it might give you an idea on how it might work.