Compare commits
2 Commits
31f063e0ae
...
6040183562
Author | SHA1 | Date | |
---|---|---|---|
6040183562 | |||
233b92a4e6 |
17
fear_tracker/routing.py
Normal file
17
fear_tracker/routing.py
Normal 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),
|
||||||
|
]),
|
||||||
|
})
|
|
@ -382,3 +382,4 @@ class StatusLongPollConsumer(AsyncHttpConsumer):
|
||||||
await self.send_response(302, b'', headers=[
|
await self.send_response(302, b'', headers=[
|
||||||
(b"Location", no_hash_status.encode('utf-8'))
|
(b"Location", no_hash_status.encode('utf-8'))
|
||||||
])
|
])
|
||||||
|
await self.http_disconnect(None)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user