# flacon
[![Build Status](https://travis-ci.org/iksaif/flacon.svg?branch=master)](https://travis-ci.org/iksaif/flacon)
[![Coverage Status](https://coveralls.io/repos/github/iksaif/flacon/badge.svg)](https://coveralls.io/github/iksaif/flacon?branch=master)
[![PyPI version](https://badge.fury.io/py/flacon.svg)](https://badge.fury.io/py/flacon)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/flacon.svg)](https://pypi.python.org/pypi/flacon/)
Flask(-Twisted/Gunicorn) microframework for microservices with Prometheus and Sentry support.
The goal is to remove most of the boilerplate necessary to start a simple HTTP application.
This provides:
* Sane arguments (`--host`, `--port`, `--debug`, `--log-level`)
* Support to have a production ready uwsgi container (`--twisted` or `--gunicorn`)
* Prometheus support with default metrics (`flacon.metrics`: See [prometheus_flask_exporter](https://github.com/rycus86/prometheus_flask_exporter))
* Optional sentry support if the `SENTRY_DSN` env var is set.
* If you have a 'static' directory in your module, just put a favicon.ico inside!
## Installation
```bash
pip install flacon
# To use a production ready wsgi server install one of the following extra requirements
pip install flacon[twisted]
pip install flacon[gunicorn]
```
## Quick-start
```python
from flacon import Flacon
flacon = Flacon(__name__)
app = flacon.app # This is a flask.Flask() app.
@app.route('/example')
def index():
return 'Example'
def main():
flacon.run()
if __name__ == '__main__':
main()
```
Want to know more? Look at [example/app.py](example/app.py), you can run it with `flacon-example`.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共29个文件
py:8个
html:7个
txt:7个
资源分类:Python库 所属语言:Python 资源全名:flacon-0.3.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
flacon-0.3.0.tar.gz (29个子文件)
flacon-0.3.0
MANIFEST.in 320B
PKG-INFO 3KB
example
app.py 2KB
templates
gourde
base.html 527B
example.html 154B
index.html 353B
static
favicon.ico 1KB
__init__.py 0B
app_test.py 804B
flacon.egg-info
PKG-INFO 3KB
requires.txt 118B
not-zip-safe 1B
SOURCES.txt 678B
entry_points.txt 53B
top_level.txt 15B
dependency_links.txt 1B
tests-requirements.txt 8B
flacon
flacon.py 10KB
templates
flacon
status.html 255B
threads.html 449B
base.html 100B
_base.html 2KB
__init__.py 123B
flacon_test.py 2KB
testutils.py 276B
setup.cfg 38B
requirements.txt 131B
setup.py 2KB
README.md 2KB
共 29 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功