testdays-web/gunicorn.cfg.py
2025-04-07 10:09:18 +02:00

17 lines
407 B
Python

import logging
import subprocess
import sys
import os
def on_starting(server):
"""Executes code before the master process is initialized"""
print("GUNICORN ON STARTING HOOOK")
os.system("python run_cli.py upgrade_db")
print("LOADING gunnicorn.cfg.py")
gunicorn_logger = logging.getLogger("gunicorn.error")
gunicorn_logger.addHandler(logging.StreamHandler(sys.stdout))
bind = "0.0.0.0:8080"