From b6dc8c127d7bda3f5e5ae205332b1388818540c5 Mon Sep 17 00:00:00 2001 From: Nyaundi Brian Date: Wed, 10 Jan 2024 07:10:23 -0800 Subject: [PATCH] Import consumers after AppRegistry is populated in tutorial step 2. (#2068) --- docs/tutorial/part_2.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/tutorial/part_2.rst b/docs/tutorial/part_2.rst index 1cc04bb2..b4104c88 100644 --- a/docs/tutorial/part_2.rst +++ b/docs/tutorial/part_2.rst @@ -263,14 +263,12 @@ The next step is to point the main ASGI configuration at the from channels.security.websocket import AllowedHostsOriginValidator from django.core.asgi import get_asgi_application - from chat.routing import websocket_urlpatterns - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") # 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() - import chat.routing + from chat.routing import websocket_urlpatterns application = ProtocolTypeRouter( {