From 48f237a92f046913d77324c8c1339e9f19ecbfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Thu, 13 Jun 2013 16:30:07 +0200 Subject: [PATCH] Print listening info to command line --- openslides/utils/tornado_webserver.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openslides/utils/tornado_webserver.py b/openslides/utils/tornado_webserver.py index 64ed6c762..b9b53ae3f 100644 --- a/openslides/utils/tornado_webserver.py +++ b/openslides/utils/tornado_webserver.py @@ -20,6 +20,7 @@ from tornado.options import options, parse_command_line from django.core.handlers.wsgi import WSGIHandler as Django_WSGIHandler from django.conf import settings +from django.utils.translation import ugettext as _ class DjangoStaticFileHandler(StaticFileHandler): @@ -41,6 +42,13 @@ def run_tornado(addr, port, reload=False): # Don't try to read the command line args from openslides parse_command_line(args=[]) + # Print listening address and port to command line + if addr == '0.0.0.0': + url_string = _("the machine's local ip address") + else: + url_string = 'http://%s:%s' % (addr, port) + print _("Starting OpenSlides' tornado webserver listening to %(url_string)s") % {'url_string': url_string} + # Start the application app = WSGIContainer(Django_WSGIHandler()) tornado_app = Application([