Print listening info to command line

This commit is contained in:
Norman Jäckel 2013-06-13 16:30:07 +02:00 committed by Oskar Hahn
parent 6dad2e5161
commit 48f237a92f

View File

@ -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([