Skip to content

Commit

Permalink
Import consumers after AppRegistry is populated in tutorial step 2. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
danleyb2 authored Jan 10, 2024
1 parent a6d7f71 commit b6dc8c1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/tutorial/part_2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit b6dc8c1

Please sign in to comment.