title: How to reference a randomly generated filename with flask
body: <p>I am creating a program that generates a chart, and then displays the chart on the webpage.  I want each chart generated to have a unique filename.  However, once that unique filename is generated, I don't know how to refer to it within the html file.</p>
  <p>I use this to create a random filename starting with &quot;chart&quot; in the &quot;images&quot; folder.  This parts works fine.</p>
  <pre><code>basename = &quot;images/chart&quot;
  suffix = str(uuid.uuid4())
  filename = &quot;_&quot;.join([basename, suffix])
  plt.savefig(filename)
  </code></pre>
  <p>I then have this in the html file, but don't know how to modify to add the random suffix part of the name that was just generated.</p>
  <pre><code>&lt;img src=&quot;{{ url_for('static', filename = '/images/chart.png') }}&quot;&gt;
  </code></pre>