Welcome to Flask-Collect¶
Welcome to Flask-Collect’s documentation.
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).
User’s Guide¶
This part of the documentation will show you how to get started in using Flask-Collect.
Quickstart¶
Flask-Collect is easy to use. For the complete guide, checkout out the API documentation on the Collect
class.
You can run:
collect.collect(verbose=True)
or with command:
$ ./manage.py collect
Requirements¶
- python >= 2.6
- Flask >= 0.8
Configuration¶
The following configuration values exist for Flask-Collect. Flask-Collect loads these values from your main Flask config which can be populated in various ways. Note that some of those cannot be modified after the engine was created so make sure to configure as early as possible and to not modify them at runtime.
Configuration Keys¶
A list of configuration keys currently understood by the extension:
COLLECT_STATIC_ROOT |
Path to folder for collect static files. By default: <APP_ROOT>/static. |
COLLECT_STORAGE |
Import path to storage backend. By default: flask_collect.storage.file. |
COLLECT_FILTER |
Import path to filter function that can
manipulate blueprints before iterating in
StorageBase() .
By default: None. |
API Reference¶
If you are looking for information on a specific function, class or method, this part of the documentation is for you.
API¶
This part of the documentation documents all the public classes and functions in Flask-Collect.
Configuration¶
-
class
flask_collect.
Collect
(app=None)¶ Extension object for integration to one or more Flask applications.
Parameters: app – Flask application app = Flask(__name__) collect = Collect(app)
The second possibility is to create the object once and configure the application later to support it:
collect = Collect() ... collect.init_app(app)
-
init_app
(app)¶ Initialize an application for the use with this collect setup.
See Configuration.
Parameters: app – Flask application
-
init_script
(manager)¶ Initialize collect scripts with Flask-Script manager instance.
Parameters: manager – Flask-Script manager This added manager collect command:
$ ./manage.py collect -h usage: ./manage.py collect [-h] [-v] Collect static from blueprints. optional arguments: -h, --help show this help message and exit -v, --verbose
-
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