From 9292558db7608f16da04e34600af4b74edca2a7a Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Thu, 28 Jan 2016 16:15:07 +0100 Subject: [PATCH] fix tornado on windows --- openslides/utils/autoupdate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openslides/utils/autoupdate.py b/openslides/utils/autoupdate.py index 4949d9691..a40fa9927 100644 --- a/openslides/utils/autoupdate.py +++ b/openslides/utils/autoupdate.py @@ -97,9 +97,15 @@ class OpenSlidesSockJSConnection(SockJSConnection): object_url. """ # Join network location with object URL. + if RUNNING_HOST == '0.0.0.0': + # Windows can not connect to 0.0.0.0. So connect to localhost instead + local_host = 'localhost' + else: + local_host = RUNNING_HOST + wsgi_network_location = ( settings.OPENSLIDES_WSGI_NETWORK_LOCATION or - 'http://{}:{}'.format(RUNNING_HOST, RUNNING_PORT)) + 'http://{}:{}'.format(local_host, RUNNING_PORT)) url = ''.join((wsgi_network_location, object_url)) # Send out internal HTTP request to get data from the REST api.