支持Prometheus和Sentry的Flask(-Twisted)微服务框架。
项目描述
gourde
支持Prometheus和Sentry的Flask(-Twisted/Gunicorn)微服务微框架。
目标是移除启动简单HTTP应用程序所需的大部分样板代码。这提供了
- 合理的参数(
--host
,--port
,--debug
,--log-level
) - 支持具有生产就绪的uwsgi容器(
--twisted
或--gunicorn
) - 默认指标的支持Prometheus支持(
gourde.metrics
:见prometheus_flask_exporter) - 如果设置了
SENTRY_DSN
环境变量,则可选的sentry支持。 - 如果您在模块中有一个'静态'目录,只需在内部放置一个favicon.ico!
安装
pip install gourde
# To use a production ready wsgi server install one of the following extra requirements
pip install gourde[twisted]
pip install gourde[gunicorn]
快速入门
from gourde import Gourde
gourde = Gourde(__name__)
app = gourde.app # This is a flask.Flask() app.
@app.route('/example')
def index():
return 'Example'
def main():
gourde.run()
if __name__ == '__main__':
main()
想了解更多吗?查看example/app.py,您可以用gourde-example
运行它。
项目详情
关闭
gourde-0.7.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7dfc021fc16919b4830eb3239c837dd7e180eae4ae20b74016ba345553b7323d |
|
MD5 | f4b5748d5d704cd19d6da4c312ef5d88 |
|
BLAKE2b-256 | 296fd3b6b75654b6283ef4d0f6dfe7ec7889ffa5d9f83a3da8754a20f14e677b |