flask-multistatic
- Author:
Pierre-Yves Chibon <pingou@pingoured.fr>
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+.
Metadata
Release files for flask-multistatic 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask-multistatic-1.0.tar.gz | 15.5 kB | Without provenance | Details for flask-multistatic-1.0.tar.gz |
Release files / flask-multistatic-1.0.tar.gz
| Download URL | flask-multistatic-1.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5e9c8e451dceb18dc6343a72021c93c5fc509fdf960fa41639c98cd33289b5c
|
|
BLAKE2b-256 checksum How to use checksums |
6041518271e2155db6dfdcfa20cafdc53c5076b103734d7f0b20aeffdd49b165
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for flask-multistatic 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.