Fixed #672: Need to reset server_cls to hand back to normal Django runserver

This commit is contained in:
Andrew Godwin 2017-06-18 14:41:05 -07:00
parent 54fa7be874
commit e2444308ff

View File

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