Skip to content

Commit

Permalink
docs: Import consumers after AppRegistry is populated
Browse files Browse the repository at this point in the history
  • Loading branch information
danleyb2 authored Jan 6, 2024
1 parent a6d7f71 commit e7c2814
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 e7c2814

Please sign in to comment.