Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Collect static files in flask application

branch: develop

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 docs Update package August 01, 2013
Octocat-spinner-32 flask_collect
Octocat-spinner-32 tests
Octocat-spinner-32 .coveragerc Update package August 01, 2013
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules Add docs September 02, 2012
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Changelog
Octocat-spinner-32 DESCRIPTION Initial release August 05, 2012
Octocat-spinner-32 LICENSE Add docs September 02, 2012
Octocat-spinner-32 MANIFEST.in Update package August 01, 2013
Octocat-spinner-32 Makefile Update makefile August 01, 2013
Octocat-spinner-32 README.rst
Octocat-spinner-32 pylama.ini
Octocat-spinner-32 requirements.txt
Octocat-spinner-32 setup.py Fix setup August 01, 2013
Octocat-spinner-32 tox.ini Fix badges August 01, 2013
README.rst

Flask-Collect

Flack-Collect is simply application for collect static files in Flask project. Serve static files with Flask -- bad idea for production, with this you will can collect them in one command.

This extension checks application blueprints for static files and copy it 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

You can run:

collect.collect(verbose=True)

or with command:

$ ./manage.py collect

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

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.