Skip to content

Commit

Permalink
migrate on app startup
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Nov 11, 2024
1 parent 655604e commit 3a7c0fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions codeforlife/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import multiprocessing
import typing as t

from django.core.management import call_command

Check warning on line 9 in codeforlife/app.py

View check run for this annotation

Codecov / codecov/patch

codeforlife/app.py#L9

Added line #L9 was not covered by tests
from gunicorn.app.base import BaseApplication # type: ignore[import-untyped]


Expand All @@ -19,6 +20,8 @@ class StandaloneApplication(BaseApplication):
"""

def __init__(self, app: t.Callable):
call_command("migrate", interactive=False)

Check warning on line 23 in codeforlife/app.py

View check run for this annotation

Codecov / codecov/patch

codeforlife/app.py#L23

Added line #L23 was not covered by tests

self.options = {
"bind": "0.0.0.0:8080",
# https://docs.gunicorn.org/en/stable/design.html#how-many-workers
Expand Down

0 comments on commit 3a7c0fa

Please sign in to comment.