diff --git a/config/asgi.py b/config/asgi.py index ab8da7f..57a7ba8 100644 --- a/config/asgi.py +++ b/config/asgi.py @@ -9,8 +9,12 @@ import os +from channels.routing import ProtocolTypeRouter from django.core.asgi import get_asgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") +# Initialize Django ASGI application early to ensure the AppRegistry +# is populated before importing code that may import ORM models. +django_asgi_app = get_asgi_application() -application = get_asgi_application() +application = ProtocolTypeRouter({"http": django_asgi_app}) diff --git a/requirements/production.txt b/requirements/production.txt index d3d40fe..732786a 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -19,5 +19,5 @@ grpcio~=1.49.1 # Others # ----------------------------------------------------------------------------- gunicorn~=20.1.0 -sentry-sdk~=1.9.1 -uvicorn~=0.18.2 +sentry-sdk~=1.9.10 +uvicorn~=0.18.3 diff --git a/requirements/test.txt b/requirements/test.txt index f6c4649..8e6e26a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -20,6 +20,7 @@ django-stubs~=1.12.0 # ----------------------------------------------------------------------------- factory-boy~=3.2.1 Faker~=15.1.1 +model-bakery~=1.8.0 pytest-cov~=4.0.0 pytest-django~=4.5.2 pytest-forked~=1.4.0 @@ -27,7 +28,6 @@ pytest-sugar~=0.9.5 pytest-xdist~=2.5.0 pytest~=7.1.3 tox~=3.26.0 -model-bakery~=1.8.0 # Coverage # -----------------------------------------------------------------------------