Update so apps load first when using asgi.py

This commit is contained in:
Andrew Chen Wang 2020-03-27 21:32:17 -04:00 committed by GitHub
parent c9744497c9
commit efbb04da91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,8 +12,6 @@ from pathlib import Path
from django.core.asgi import get_asgi_application from django.core.asgi import get_asgi_application
from .websocket import websocket_application
# This allows easy placement of apps within the interior # This allows easy placement of apps within the interior
# {{ cookiecutter.project_slug }} directory. # {{ cookiecutter.project_slug }} directory.
app_path = Path(__file__).parents[1].resolve() app_path = Path(__file__).parents[1].resolve()
@ -32,6 +30,9 @@ django_application = get_asgi_application()
# from helloworld.asgi import HelloWorldApplication # from helloworld.asgi import HelloWorldApplication
# application = HelloWorldApplication(application) # application = HelloWorldApplication(application)
# Importing websocket application so that apps are loaded first
from .websocket import websocket_application # noqa
async def application(scope, receive, send): async def application(scope, receive, send):
if scope["type"] == "http": if scope["type"] == "http":