Question: I want to do something like this:

```
app = Flask(__name__)
app.config.from_object(mypackage.config)
app.static_url_path = app.config['PREFIX']+"/static"

```

when I try:

```
print app.static_url_path

```

I get the correct `static_url_path`

But in my templates when I use `url_for('static')`, The html file generated using jinja2 still has the default static URL path `/static` with the missing `PREFIX` that I added.

If I hardcode the path like this:

```
app = Flask(__name__, static_url_path='PREFIX/static')

```

It works fine. What am I doing wrong?

Answer: 
Just to complete the answer above, we also need to clear the view\_functions that maps the endpoint with the delegate:

```
app.view_functions["static"] = None

```
I think you missed `static_folder`

```
app = Flask(__name__)
app.config.from_object(mypackage.config)
app.static_url_path = app.config['PREFIX']+"/static"
app.static_folder = app.config['PREFIX']+"/static"

```