Flask-Collect-Invenio -- Collect static files in Flask application
Project description
Flask-Collect-Invenio is a fork and drop-in replacement of the original Flask-Collect extension with adjustments to make it compatible with Flask 2.x.
Even though serving static files with Flask is a bad idea in a production environment, this tool will help you collect them in one command. It checks application and blueprints for static files and copies them to a specific folder (saves related paths).
Docs are available at http://flask-collect-invenio.readthedocs.org/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.
Requirements
Python 3.6+
Flask >= 0.10.1
Installation
Flask-Collect-Invenio should be installed using pip:
pip install Flask-Collect-Invenio
Setup
Flask-Collect-Invenio settings (default values):
# Target static dir COLLECT_STATIC_ROOT = <APP.ROOT_PATH>/static COLLECT_STORAGE = 'flask_collect.storage.file'
Initialize Flask-Collect-Invenio extension:
from flask_collect import Collect ... collect = Collect() collect.init_app(app)
If you use Flask-Script, activate Flask-Collect-Invenio commands:
from flask_collect import Collect ... manager = Manager() ... collect = Collect() collect.init_app(app) collect.init_script(manager)
If you configure Flask via a factory function:
from flask_collect import Collect ... def create_app(): app = Flask() ... collect = Collect() collect.init_app(app) return app
Use Flask-Collect-Invenio
From any python script:
collect.collect(verbose=True)
with Flask-Script:
$ ./manage.py collect
with Flask>=0.11:
$ flask collect
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/inveniosoftware/Flask-Collect-Invenio/issues
Contributors
Original Author: Kirill Klenov (horneds@gmail.com)
Also see the CONTRIBUTORS.rst file.
Contributing
Development of flask-collect-invenio happens at github: https://github.com/inveniosoftware/Flask-Collect-Invenio
License
Licensed under a BSD license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Flask-Collect-Invenio-1.4.0.tar.gz
.
File metadata
- Download URL: Flask-Collect-Invenio-1.4.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52c8343773f6366bb1594905e5c8e1f92101ec06c20e966420237ddad2a7918a |
|
MD5 | 44adadc98af18e8b34592329878a12fb |
|
BLAKE2b-256 | 1def1b253332bd27ddb4152f7702e7c91b5d9048086edd1930c7a3ed97af56cf |
File details
Details for the file Flask_Collect_Invenio-1.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: Flask_Collect_Invenio-1.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf969b7cddf27086ee19883e9660aeac2d455646cbad2a43799660b3cc0cbffb |
|
MD5 | d44628f8c5970f0c277e6272140c38a2 |
|
BLAKE2b-256 | 9a42d92da307dddb7e4589e7cada9d6abeb144c20d990f34dd3edc2f96a26b34 |