Re: [flask] Change static_folder From Configuration File
- Simon Sapin
- 2012-10-05 @ 12:04
Le 05/10/2012 12:25, Ji Zhang a écrit :
> I can change the static_folder when I create the app, like:
> app = Flask(__name__, static_folder='static-built')
> But what if I wanna get it done in a configuration file?
> # config.py
> STATIC_FOLDER = 'static-built'
> # __init__.py
> app = Flask(__name__)
This could be done by overriding the static_folder property in a
subclass. I wrote a code example in a snippet: