WIP: long polling support
#1
Draft
perelman
wants to merge 10 commits from feature/long-poll-status
into history/short-polling-only
@ -0,0 +1,16 @@
|
||||
from channels.http import AsgiHandler
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
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),
|
||||
]),
|
||||
})
|
@ -0,0 +1,12 @@
|
||||
"""
|
||||
ASGI entrypoint. Configures Django and then runs the application
|
||||
defined in the ASGI_APPLICATION setting.
|
||||
"""
|
||||
|
||||
import os
|
||||
import django
|
||||
from channels.routing import get_default_application
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fear_tracker_site.settings")
|
||||
django.setup()
|
||||
application = get_default_application()
|
@ -0,0 +1,3 @@
|
||||
import fear_tracker.routing
|
||||
|
||||
application = fear_tracker.routing.application
|
Loading…
Reference in New Issue