Confronta commit

..

2 Commit

Autore SHA1 Messaggio Data
6040183562 Disconnect when done with status consumer. 2020-04-11 18:25:22 -07:00
233b92a4e6 Add missing routing.py file. 2020-04-11 18:24:58 -07:00
2 ha cambiato i file con 18 aggiunte e 0 eliminazioni

17
fear_tracker/routing.py Normal file
Vedi File

@ -0,0 +1,17 @@
from channels.http import AsgiHandler
from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from . import views
# No async routing currently; just default sync http.
application = ProtocolTypeRouter({
"http": URLRouter([
url(r'^(?P<access_code>[a-zA-Z]{6})/', URLRouter([
url(r"status/(?P<hashcode>[a-z0-9]{64})/",
views.StatusLongPollConsumer, name='status'),
])),
url(r"", AsgiHandler),
]),
})

Vedi File

@ -382,3 +382,4 @@ class StatusLongPollConsumer(AsyncHttpConsumer):
await self.send_response(302, b'', headers=[
(b"Location", no_hash_status.encode('utf-8'))
])
await self.http_disconnect(None)