1Flask-Collect 2############# 3 4.. _description: 5 6**Flask-Collect** is an extension for Flask that helps collecting static files. 7 8Serving static files with *Flask* -- bad idea for production, this tool will 9help you collect them in one command. It checks application and blueprints for 10static files and copy them to specific folder (saves related paths). 11 12.. _badges: 13 14.. image:: http://img.shields.io/travis/klen/Flask-Collect.svg?style=flat-square 15 :target: http://travis-ci.org/klen/Flask-Collect 16 :alt: Build Status 17 18.. image:: http://img.shields.io/coveralls/klen/Flask-Collect.svg?style=flat-square 19 :target: https://coveralls.io/r/klen/Flask-Collect 20 :alt: Coverals 21 22.. image:: http://img.shields.io/pypi/v/flask-collect.svg?style=flat-square 23 :target: https://pypi.python.org/pypi/flask-collect 24 :alt: Version 25 26.. image:: http://img.shields.io/pypi/dm/flask-collect.svg?style=flat-square 27 :target: https://pypi.python.org/pypi/flask-collect 28 :alt: Downloads 29 30 31.. _documentation: 32 33**Docs are available at** http://flask-collect.readthedocs.org/. **Pull 34requests with documentation enhancements and/or fixes are awesome and most 35welcome.** 36 37.. _contents: 38 39.. contents:: 40 41 42.. _requirements: 43 44Requirements 45============= 46 47- python (2.6, 2.7, 3.3) 48- Flask_ >= 0.10.1 49 50 51.. _installation: 52 53Installation 54============ 55 56**Flask-Collect** should be installed using pip: :: 57 58 pip install Flask-Collect 59 60 61.. _setup: 62 63Setup 64===== 65 66Flask-Collect settings (default values): :: 67 68 # Target static dir 69 COLLECT_STATIC_ROOT = <APP.ROOT_PATH>/static 70 COLLECT_STORAGE = 'flask_collect.storage.file' 71 72Initialize Flask-Collect extension: :: 73 74 from flask_collect import Collect 75 76 ... 77 78 collect = Collect() 79 collect.init_app(app) 80 81If you use Flask-Script_, activate Flask-Collect commands: :: 82 83 from flask_collect import Collect 84 85 ... 86 manager = Manager() 87 ... 88 89 collect = Collect() 90 collect.init_app(app) 91 collect.init_script(manager) 92 93If you configure Flask via a factory function:: 94 95 from flask_collect import Collect 96 97 ... 98 99 def create_app(): 100 app = Flask() 101 ... 102 collect = Collect() 103 collect.init_app(app) 104 105 return app 106 107 108.. _usage: 109 110Use Flask-Collect 111================= 112 113From any python script: :: 114 115 collect.collect(verbose=True) 116 117with Flask-Script_: :: 118 119 $ ./manage.py collect 120 121with Flask>=0.11: :: 122 123 $ flask collect 124 125 126.. _bugtracker: 127 128Bug tracker 129=========== 130 131If you have any suggestions, bug reports or annoyances please report them 132to the issue tracker at https://github.com/klen/Flask-Collect/issues 133 134 135.. _contributing: 136 137Contributors 138============ 139 140Maintainer: Kirill Klenov (horneds@gmail.com) 141 142Also see the `CONTRIBUTORS.rst 143<https://github.com/klen/Flask-Collect/blob/develop/CONTRIBUTORS.rst>`_ 144file. 145 146Contributing 147============ 148 149Development of flask-collect happens at github: 150https://github.com/klen/Flask-Collect 151 152 153.. _license: 154 155License 156======= 157 158Licensed under a `BSD license`_. 159 160 161.. _links: 162 163.. _BSD license: http://www.linfo.org/bsdlicense.html 164.. _klen: http://klen.github.com/ 165.. _SQLAlchemy: http://www.sqlalchemy.org/ 166.. _Flask: http://flask.pocoo.org/ 167.. _Flask-Script: http://github.com/rduplain/flask-script 168