You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
636 B
Python
22 lines
636 B
Python
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
|
|
import django
|
|
from django.conf.urls import url
|
|
from django.core.asgi import get_asgi_application
|
|
|
|
# TODO Importing views breaks if django.setup() isn't called first...
|
|
# ... but this isn't the way this is supposed to work.
|
|
django.setup()
|
|
|
|
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.as_asgi(), name='status'),
|
|
])),
|
|
url(r"", get_asgi_application()),
|
|
]),
|
|
})
|