I have a database with population data. I want to create a page that shows a figure of this data (with for example matplotlib). How and where would I store the figures which I create with matplotlib?
Example data:
year | people
2010 | 100
2011 | 110
2012 | 110
2013 | 114
2014 | 124
2015 | 154
2016 | 143
2017 | 112
In my view I already have collected the variable, year and people. I would normally do something like this:
plt.plot(year, people)
plt.savefig('figure.svg')
The question is where/how would I store this and present it to the user? Should I store this in a media directory? I do not want to store the file forever cause then diskspace would quickly fill up with graphs which are only used once.