Skip to main content

seatools gunicorn 服务器启动器

该框架在gunicorn层完成seatools.ioc的加载, 使用该项目后无需在每个进程额外执行seatools.ioc.run函数, 仅在启动时传递一个ioc启动的函数即可

使用指南

  1. 安装, poetry add seatools-starter-server-gunicorn
  2. 这里以fastapi为例, 假设xxx.boot模块存在start的自定义启动ioc函数
from seatools.ioc import run


def start():
    run(scan_package_names='xxx', config_dir='./config')

命令行启动gunicorn xxx.boot:start xxx.fastapi.app:app, 其他参数与官方gunicorn一致, 在gunicorn基础上增加了一个ioc_app的参数, 需要指明ioc应用启动的函数 若配置application.yml或application-[*].yml中存在seatools.server.gunicorn.app配置, 则可不传递gunicorn的app仅传递ioc_app即可, 示例gunicorn xxx.boot:start 若同时使用了seatools-starter-web-*的web启动包, 则gunicorn的app直接可省略 4. 支持配置config/application.yml

seatools:
  server:
    gunicorn:
      # 配置该参数后启动参数可忽略app参数, 配置与官方gunicorn.app.wsgiapp.run一致, 若安装 seatools-starter-web-* 可省略app配置 
      app: xxx.fastapi.app:app
      bind: ':8000'
      workers: 2
      worker_class: gevent
      ...
    

Metadata

Release files for seatools-starter-server-gunicorn 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seatools-starter-server-gunicorn 1.0.0
File Size Uploaded Provenance Actions
seatools_starter_server_gunicorn-1.0.0.tar.gz 3.1 kB Without provenance Details for seatools_starter_server_gunicorn-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seatools-starter-server-gunicorn 1.0.0
File Interpreter ABI Platform Actions
seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl Python 3 none any Details for seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl

Total release size: 7.4 kB

Release files / seatools_starter_server_gunicorn-1.0.0.tar.gz

Download URL seatools_starter_server_gunicorn-1.0.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
21437f72f346d474aff710692cdaf5255ad4847c31858262c348c47192a14426
BLAKE2b-256 checksum
How to use checksums
7f933020331a9a90f212e96bbb8043dfbe7f074f80820a026ca221a5cc83f661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Release files / seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl

Download URL seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0835deeec3421436cf2cc0c3af74a2bfd1572aa960b288d8eb790f2890f3945
BLAKE2b-256 checksum
How to use checksums
cc8ffd10d1c9b8478cd2cfd68c00058c8dafef4db83b77849365d3d471c0a0fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.9

Security for seatools-starter-server-gunicorn 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page