网络与远程连接

gunicorn:Python 的 WSGI HTTP 服务器

· 52CE 我爱测

适用场景 Python 的 WSGI HTTP 服务器。 本条为命令参考与排查示例;请先确认命令已安装,再按示例定位实际参数和输出。 gunicorn Python 的 WSGI HTTP 服务器。 更多信息:。 - 运行 Python web 应用程序: gunicorn {{导入路径:应用程序}} - 在 localhost 上监听 8080 端口: gunicorn {{-b|--bind}} localhost:8080 {{导入路径:应用程序}}

适用场景

Python 的 WSGI HTTP 服务器。 本条为命令参考与排查示例;请先确认命令已安装,再按示例定位实际参数和输出。

gunicorn

Python 的 WSGI HTTP 服务器。 更多信息:https://manned.org/gunicorn。

  • 运行 Python web 应用程序:

gunicorn {{导入路径:应用程序}}

  • 在 localhost 上监听 8080 端口:

gunicorn {{[-b|--bind]}} localhost:8080 {{导入路径:应用程序}}

  • 启用实时自动加载:

gunicorn --reload {{导入路径:应用程序}}

  • 使用 4 个工作进程处理请求:

gunicorn {{[-w|--workers]}} 4 {{导入路径:应用程序}}

  • 使用 4 个工作线程处理请求:

gunicorn --threads 4 {{导入路径:应用程序}}

  • 通过 HTTPS 运行应用程序:

gunicorn --certfile {{cert.pem}} --keyfile {{key.pem}} {{导入路径:应用程序}}

资料来源与适用范围

资料来源
tldr 中文命令参考
适用范围
Linux / Unix;具体选项随发行版和命令版本变化
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-10-26
授权说明
CC BY 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。