Skip to main content

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).

Version Downloads https://img.shields.io/badge/code%20style-black-000000.svg

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_collect_invenio-1.4.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_collect_invenio-1.4.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file flask_collect_invenio-1.4.1.tar.gz.

File metadata

  • Download URL: flask_collect_invenio-1.4.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for flask_collect_invenio-1.4.1.tar.gz
Algorithm Hash digest
SHA256 caf1ac862828997487b2508f9ad17970fcbc33ab3d1799cb59f392102e907dc7
MD5 7460ba4748191b7986f49530c6d85ff2
BLAKE2b-256 439dfda8a9b590a779931b36b02ebed731831dc87db7078a1b51b7cf2b04d01b

See more details on using hashes here.

File details

Details for the file flask_collect_invenio-1.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_collect_invenio-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c289b4a8990e9f8e1356a3eeee13496883e5aa1ca616e126a7275dd9efdf1c97
MD5 b5b56fdfe8b1de0e9fd594f83225eee5
BLAKE2b-256 48138b9d7e28ac69e5346b57a301137e722054c8a9f535411f598333e510ad16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page