Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Collect static files in flask application
Python Makefile CSS
Failed to load latest commit information.
docs Fix docs
flask_collect Bump version: 1.2.0 → 1.2.1
tests Little refactoring
.bumpversion.cfg Bump version: 1.2.0 → 1.2.1
.coveragerc
.gitignore Update README
.gitmodules Add docs
.travis.yml Testing Python 3.4
CONTRIBUTORS.rst Little refactoring
Changelog Update changelog
DESCRIPTION Initial release
LICENSE Add docs
MANIFEST.in Update contributors
Makefile
README.rst Fix badges
pylama.ini Migrate to new version of pylama
requirements.txt Update package
setup.cfg Migrate to new version of pylama
setup.py Testing Python 3.4
tox.ini Testing Python 3.4

README.rst

Flask-Collect

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

Something went wrong with that request. Please try again.