Debian Codegraph @

/

debian flask-multistatic 1.0-5debian python3-flaskext.multistatic python flask-multistatic 1.0 debianinimakefilepythonshellyaml 13 files · 67 symbols
View dependency graph

Depends on

README (full)

flask-multistatic

:Author: Pierre-Yves Chibon <[email protected]>

This project is a simple flask plugin to add support for overriding static files.

Dependencies:

The dependency list is therefore:

Usage:

In your flask application:

import flask
from flask_multistatic import MultiStaticFlask

And replace the way you build you flask application from

APP = flask.Flask(__name__)

by

APP = MultiStaticFlask(__name__)

You can then specify multiple folder where static files are located, for example:

APP.static_folder = [
    os.path.join(APP.root_path, 'static', APP.config['THEME_FOLDER']),
    os.path.join(APP.root_path, 'static', 'default')
]

Production:

Note that this is most likely less efficient than having apache serve the static files itself, but even if you do that you might want to have multiple static directories and have apache fallback.

In this case, you can use the example.conf file that is shipped as part of this repository.

The example.conf file has an example configuration that will try to serve a file from an instance-specific theme directory, and only if the file was not found, fall back to the application default theme.

License:

This project is licensed GPLv3+.

dir debian/
dir flask_multistatic.egg-info/
file LICENSE
file MANIFEST.in
file PKG-INFO
file README.rst
file example.conf
file flask_multistatic.py
file setup.cfg
file setup.py