title: Static files not working, using jinja in Flask
body: <p>I'm a beginner using Flask. My static files don't working, the root 
  I've this tree directories :</p>
  
  <pre><code>/          &lt;-------------- launching (flask run) the site, here.
  /static
  /static/css
  /static/js
  /static/img
  /flask_mysite
  /flask_mysite/log
  /flask_mysite/templates
  </code></pre>
  
  <p>The flask app variable : </p>
  
  <pre><code>$ echo $FLASK_APP
  flask_mysite/__init__.py
  </code></pre>
  
  <p>To navigate <strong>in the root <code>/</code> folder</strong>, using an vagrant VM : </p>
  
  <pre><code>flask run --host=192.168.56.101
  </code></pre>
  
  <p>In the <em>/flask_mysite/__init.py__</em> I've the jinjia config : </p>
  
  <pre><code>flask_mysite.jinja_env.globals['static'] = (
      lambda filename: url_for('static', filename=filename)
  )
  
  from flask_mysiteimport views, models
  
  if __name__ == '__main__':
      flask_mysite.run(debug=True)
  </code></pre>
  
  <p>And, in the <em>/flask_mysite/templates/base.html</em>, for example : </p>
  
  <pre><code>&lt;link rel="stylesheet" href="{{ static('css/main.css') }}"&gt;
  </code></pre>
  
  <p>And so, the html generated : </p>
  
  <pre><code>&lt;link rel="stylesheet" href="/static/css/main.css"&gt;
  </code></pre>
  
  <p>Can anobody can help me please ? :)</p>
  
  <p>Thanks.
  Fabrice</p>