Compare commits

...

2 Commits

2 changed files with 18 additions and 0 deletions

17
fear_tracker/routing.py Normal file
View 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),
]),
})

View 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)