Skip to content

Commit

Permalink
Fix websockets (#137)
Browse files Browse the repository at this point in the history
* Fix websockets in dev environment

* Fix websockets in prod

* Fix websockets
  • Loading branch information
david-cooke authored Jul 24, 2021
1 parent d7abdd4 commit a0ee526
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/challenge/signals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.core.cache import caches
from django.db.models.signals import post_save, post_delete
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver

from challenge.models import Challenge
Expand Down
7 changes: 6 additions & 1 deletion src/sockets/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
application = ProtocolTypeRouter(
{
"websocket": AuthMiddlewareStack(
URLRouter([re_path(r"^ws/$", consumers.EventConsumer), re_path(r"^api/v2/ws/$", consumers.EventConsumer)])
URLRouter(
[
re_path(r"^ws/$", consumers.EventConsumer.as_asgi()),
re_path(r"^api/v2/ws/$", consumers.EventConsumer.as_asgi()),
]
)
)
}
)

0 comments on commit a0ee526

Please sign in to comment.