Is that possible to add more static paths for my local dev Flask instance?
I want to have default static
folder for storing js/css/images files for the site and
I have been using following approach:
# Custom static data
@app.route('/cdn/')
def custom_static(filename):
return send_from_directory(app.config['CUSTOM_STATIC_PATH'], filename)
The CUSTOM_STATIC_PATH
variable is defined in my configuration.
And in templates:
{{ url_for('custom_static', filename='foo') }}
Caveat emptor - I'm not really sure whether it's secure ;)