diff --git a/app.py b/app.py index 93e6d33..6f73f21 100644 --- a/app.py +++ b/app.py @@ -550,8 +550,11 @@ def gone(error): # ── Entry point ─────────────────────────────────────────────────────────────── +# Always initialise the DB when the module is imported (works under Gunicorn +# and other WSGI servers that import app directly, not just via wsgi.py). +init_db() + if __name__ == '__main__': - init_db() app.run( debug=_server.get('debug', False), host=_server.get('host', '0.0.0.0'),