-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Django handler to daphne config
- Loading branch information
1 parent
74205dd
commit 3451c45
Showing
1 changed file
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import os | ||
|
||
from channels.auth import AuthMiddlewareStack | ||
from channels.routing import ProtocolTypeRouter, URLRouter | ||
from django.core.asgi import get_asgi_application | ||
from django.urls import path | ||
|
||
from . import consumers | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "concordia.settings") | ||
django_asgi_app = get_asgi_application() | ||
|
||
application = ProtocolTypeRouter( | ||
{ | ||
# (http->django views is added by default) | ||
"http": django_asgi_app, | ||
"websocket": AuthMiddlewareStack( | ||
URLRouter([path("ws/asset/asset_updates/", consumers.AssetConsumer)]) | ||
) | ||
), | ||
} | ||
) |