Skip to main content

Flask-Collect -- Collect static files in Flask application

Project description

Flask-Collect is an extension for Flask that helps collecting static files.

Serving static files with Flask – bad idea for production, this tool will help you collect them in one command. It checks application and blueprints for static files and copy them to specific folder (saves related paths).

Build Status Coverals Version Downloads License Donate

Docs are available at http://flask-collect.readthedocs.org/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.

Requirements

  • python (2.6, 2.7, 3.3)

  • Flask >= 0.10.1

Installation

Flask-Collect should be installed using pip:

pip install Flask-Collect

Setup

Flask-Collect settings (default values):

# Target static dir
COLLECT_STATIC_ROOT = <APP.ROOT_PATH>/static
COLLECT_STORAGE = 'flask.ext.collect.storage.file'

Initialize Flask-Collect extenstion:

from flask.ext.collect import Collect

...

collect = Collect()
collect.init_app(app)

If you use Flask-Script, activate Flask-Collect commands:

from flask.ext.collect import Collect

...
manager = Manager()
...

collect = Collect()
collect.init_app(app)
collect.init_script(manager)

Use Flask-Collect

From any python script:

collect.collect(remove=True, verbose=True)

with Flask-Script:

$ ./manage.py collect –remove

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/Flask-Collect/issues

Contributors

Maintainer: Kirill Klenov (horneds@gmail.com)

Also see the CONTRIBUTORS.rst file.

Contributing

Development of flask-collect happens at github: https://github.com/klen/Flask-Collect

License

Licensed under a BSD license.

Project details


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-1.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

Flask_Collect-1.2.0-py2.py3-none-any.whl (11.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Flask-Collect-1.2.0.tar.gz.

File metadata

File hashes

Hashes for Flask-Collect-1.2.0.tar.gz
Algorithm Hash digest
SHA256 737bfedede7e90ee452090759a22db07da8f4ef601c3ff0271d422326f7407e3
MD5 8d7a07f73bd847d5ba3acce08d11193a
BLAKE2b-256 9e474e3a398a55bb68ae857f225041ad14e853cf384b8b7c762163a8574ae71b

See more details on using hashes here.

File details

Details for the file Flask_Collect-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Collect-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0fc68d4c4777f6241de3ac54dae91b17a1720b3f933b268892457ba9ec779dab
MD5 37155b70b28ca18d2cc2fba4b463e6a4
BLAKE2b-256 4e86b98a8d95291f197fef4594773a532faa87d0bca5314292abb09ac9833fc8

See more details on using hashes here.

Supported by

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