title: How to set static_url_path in Flask application
body: <p>I want to do something like this:</p>
  
  <pre><code>app = Flask(__name__)
  app.config.from_object(mypackage.config)
  app.static_url_path = app.config['PREFIX']+"/static"
  </code></pre>
  
  <p>when I try:</p>
  
  <pre><code>print app.static_url_path
  </code></pre>
  
  <p>I get the correct <code>static_url_path</code></p>
  
  <p>But in my templates when I use <code>url_for('static')</code>, The html file generated using jinja2 still has the default static URL path <code>/static</code> with the missing <code>PREFIX</code> that I added.</p>
  
  <p>If I hardcode the path like this:</p>
  
  <pre><code>app = Flask(__name__, static_url_path='PREFIX/static')
  </code></pre>
  
  <p>It works fine. What am I doing wrong?</p>