Backport of Flask 1.0 new click integration.
Project description
About
Flask-CLI is a backport of Flask 1.0 new click integration to Flask 0.10. Do not install this package if you use Flask 1.0+.
Installation
Flask-CLI is on PyPI so all you need is:
pip install flask-cli
Usage
Initialize the extension like this:
from flask import Flask
from flask_cli import FlaskCLI
app = Flask('myapp')
FlaskCLI(app)
@app.cli.command()
def mycmd():
click.echo("Test")
@app.shell_context_processor
def myctx():
return {'myvar': 'value'}
Import from this library instead of flask.cli:
from flask_cli import FlaskGroup
Documentation
Documentation is readable at http://flask-cli.readthedocs.org or can be build using Sphinx:
pip install Sphinx python setup.py build_sphinx
Testing
Running the test suite is as simple as:
python setup.py test
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-CLI-0.3.0.tar.gz
(21.0 kB
view hashes)
Built Distribution
Close
Hashes for Flask_CLI-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4a45f3b8baa8072db6112cbac04453a89362c0b8e41ed2136a4e3af1c019652 |
|
MD5 | 4e8ad3c95a511516fafc96d0d0c87c89 |
|
BLAKE2b-256 | 85976521457590427e584546168135b07e8f666ee912e0c5397b1714de357446 |