项目概述
An ASGI web server, for Python. 🦄
项目地址
https://github.com/Kludex/uvicorn
项目页面预览

关键指标
- Stars:10291
- 主要语言:Python
- License:BSD 3-Clause “New” or “Revised” License
- 最近更新:2026-01-01T08:09:15Z
- 默认分支:main
本站高速下载(国内可用)
点击下载(本站镜像)
– SHA256:76f86d51f782fc979d1088ae8ae2b1b39ab1bd6513d47cad223aa230cab812fd
安装部署要点(README 精选)
Quickstart
Install using pip:
$ pip install uvicorn
This will install uvicorn with minimal (pure Python) dependencies.
$ pip install 'uvicorn[standard]'
This will install uvicorn with “Cython-based” dependencies (where possible) and other “optional extras”.
In this context, “Cython-based” means the following:
- the event loop
uvloopwill be installed and used if possible. - the http protocol will be handled by
httptoolsif possible.
Moreover, “optional extras” means that:
- the websocket protocol will be handled by
websockets(should you want to usewsprotoyou’d need to install it manually) if possible. - the
--reloadflag in development mode will usewatchfiles. - windows users will have
coloramainstalled for the colored logs. python-dotenvwill be installed should you want to use the--env-fileoption.PyYAMLwill be installed to allow you to provide a.yamlfile to--log-config, if desired.
Create an application, in example.py:
async def app(scope, receive, send):
assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
(b'content-type', b'text/plain'),
],
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
Run the server:
$ uvicorn example:app
常用命令(从 README 提取)
$ pip install uvicorn
$ pip install 'uvicorn[standard]'
$ uvicorn example:app
通用部署说明
- 下载源码并阅读 README
- 安装依赖(pip/npm/yarn 等)
- 配置环境变量(API Key、模型路径、数据库等)
- 启动服务并测试访问
- 上线建议:Nginx 反代 + HTTPS + 进程守护(systemd / pm2)
免责声明与版权说明
本文仅做开源项目整理与教程索引,源码版权归原作者所有,请遵循对应 License 合规使用。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END








暂无评论内容