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( {