title: Link to Flask static files with url_for
body: <p>How do you use <code>url_for</code> in Flask to reference a file in a folder?  For example, I have some static files in the <code>static</code> folder, some of which may be in subfolders such as <code>static/bootstrap</code>.</p>
  
  <p>When I try to serve a file from <code>static/bootstrap</code>, I get an error.</p>
  
  <pre><code> &lt;link rel=stylesheet type=text/css href="{{ url_for('static/bootstrap', filename='bootstrap.min.css') }}"&gt;
  </code></pre>
  
  <p>I can reference files that aren't in subfolders with this, which works.</p>
  
  <pre><code> &lt;link rel=stylesheet type=text/css href="{{ url_for('static', filename='bootstrap.min.css') }}"&gt;
  </code></pre>
  
  <p>What is the correct way to reference static files with <code>url_for</code>?  How do I use <code>url_for</code> to generate urls to static files at any level?</p>