starlette Python轻量级的ASGI框架

starlette简介

starlette,Python第三方库,轻量级ASGI框架/工具包,支持WebSocket,适合使用Python构建异步web服务。

starlette应用实例

from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route


async def homepage(request):
    return JSONResponse({'hello': 'world, hello, 笨鸟工具x1y1z1.com'})

routes = [
    Route("/", endpoint=homepage)
]

app = Starlette(debug=True, routes=routes)

starlette Github统计数据

BSD-3-Clause license

Github 8.9k stars

starlette安装命令

pip3 install starlette

Python版本要求

Python 3.8+

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.