Add auto-installation of gunicorn if not present in environment

This commit is contained in:
yangdx
2025-03-01 15:34:01 +08:00
parent ab704aae47
commit 3511b9805c

View File

@@ -45,6 +45,12 @@ def main():
print(f"Workers setting: {args.workers}")
print("=" * 80 + "\n")
# Check and install gunicorn if not present
import pipmaster as pm
if not pm.is_installed("gunicorn"):
print("Installing gunicorn...")
pm.install("gunicorn")
# Import Gunicorn's StandaloneApplication
from gunicorn.app.base import BaseApplication