From 3a7c0faec937c404e8ff8f608aa547abf27467ce Mon Sep 17 00:00:00 2001 From: SKairinos Date: Mon, 11 Nov 2024 13:12:45 +0000 Subject: [PATCH] migrate on app startup --- codeforlife/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codeforlife/app.py b/codeforlife/app.py index 963dd5a..b46cf1f 100644 --- a/codeforlife/app.py +++ b/codeforlife/app.py @@ -6,6 +6,7 @@ import multiprocessing import typing as t +from django.core.management import call_command from gunicorn.app.base import BaseApplication # type: ignore[import-untyped] @@ -19,6 +20,8 @@ class StandaloneApplication(BaseApplication): """ def __init__(self, app: t.Callable): + call_command("migrate", interactive=False) + self.options = { "bind": "0.0.0.0:8080", # https://docs.gunicorn.org/en/stable/design.html#how-many-workers