Seatools gunicorn server starter.
Project description
seatools gunicorn 服务器启动器
该框架在gunicorn层完成seatools.ioc的加载, 使用该项目后无需在每个进程额外执行seatools.ioc.run函数, 仅在启动时传递一个ioc启动的函数即可
使用指南
- 安装,
poetry add seatools-starter-server-gunicorn - 这里以
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
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seatools_starter_server_gunicorn-1.0.0.tar.gz.
File metadata
- Download URL: seatools_starter_server_gunicorn-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21437f72f346d474aff710692cdaf5255ad4847c31858262c348c47192a14426
|
|
| MD5 |
e232c435b42d86a1bb84f6e56398a8fd
|
|
| BLAKE2b-256 |
7f933020331a9a90f212e96bbb8043dfbe7f074f80820a026ca221a5cc83f661
|
File details
Details for the file seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl.
File metadata
- Download URL: seatools_starter_server_gunicorn-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0835deeec3421436cf2cc0c3af74a2bfd1572aa960b288d8eb790f2890f3945
|
|
| MD5 |
b70d884fd198c13483231404f8de9a37
|
|
| BLAKE2b-256 |
cc8ffd10d1c9b8478cd2cfd68c00058c8dafef4db83b77849365d3d471c0a0fc
|