Graphs not updating in Heroku deployed Django app

I recently deployed a Django app on Heroku and it was working as intended, basically the user types in a string which fetches data from an API and then that data is used to generate graphs, which are saved in the static folder and are then loaded to the HTML, but recently it stopped working as intended.

     <img src="{% static 'app-name/graph_one.svg' %}" id="graph_one" class="img-fluid" alt="Graph One"/>

Normal use case is that each new search by the user would make the program generate new graphs which would replace the old, and serve the newly replaced ones to the user.

Now, when I type in new searches I can see the data is updated but the graphs are not. It looks like the program is still generating new graphs as intended, but when I check the HTML I get this oddity.


So for some reason the app is now serving these files with added strings, while the new/updated files are in the background. When I look into the deployed folder I see all my graph files are duplicated, one set with these odd strings and one set without (which is what I intended).

Actually, when I try to directly type into the browser the path without the strange string ( so static/app-name/graph_one.svg) I still get the outdated graph. It looks like the graphs aren't being replaced, even though the code locally works just fine (the deployed and local are on the same version).

Appreciate any help and guidance in this!

I tried to check whether it was an issue in the database, but the data appears to be loading fine from the API and the non-graph-procesesed data appear as intended on the page. It's just the graphs (.svg) which aren't updated. I am using matplotlib to generate the graphs.

Back to Top