Use WSGI runserver if no channel backend configured

This commit is contained in:
Andrew Godwin 2016-03-10 17:53:06 -08:00
parent b4c73ae6a5
commit 053850fdd6

View File

@ -31,7 +31,7 @@ class Command(RunserverCommand):
def inner_run(self, *args, **options):
# Maybe they want the wsgi one?
if not options.get("use_asgi", True):
if not options.get("use_asgi", True) or DEFAULT_CHANNEL_LAYER not in channel_layers:
return RunserverCommand.inner_run(self, *args, **options)
# Check a handler is registered for http reqs; if not, add default one
self.channel_layer = channel_layers[DEFAULT_CHANNEL_LAYER]