def create_app(): config = ConfigParser() config.read('settings.ini') connection.db_url = config['Database']['url'] settings = { "static_path": os.path.join(os.getcwd(), 'server', 'common', 'resources'), "static_url_prefix": "/resources/", "template_path": os.path.join(os.getcwd(), 'server'), "cookie_secret": config["Server"]["cookie_secret"], "login_url": "/login", } app = Application(get_handlers(), **settings) app.listen(int(config['Server']['port']), config['Server']['address']) return app
def create_app(): config = ConfigParser() config.read('settings.ini') connection.db_url = config['Database']['url'] puerto = config['Server']['port'] vaciar_puerto(puerto) settings = get_settings(config) Thread(target=launch_schedule).start() app = Application(get_handlers(), **settings, default_handler_class=Error404Handler) app.listen(int(config['Server']['port']), config['Server']['address']) print('running server on http://'+config['Server']['address']+':'+config['Server']['port']) #app.listen(int(config['Server']['port']), socket.gethostbyname(socket.gethostname())) #print('running server on http://'+socket.gethostbyname(socket.gethostname())+':'+config['Server']['port']) IOLoop.instance().start()
def create_app(): config = ConfigParser() config.read('settings.ini') connection.db_url = config['Database']['url'] settings = get_settings(config) app = Application(get_handlers(), **settings, default_handler_class=Error404Handler) # app.listen(int(config['Server']['port']), config['Server']['address']) # print('running server on http://'+config['Server']['address']+':'+config['Server']['port']) # print(socket.gethostbyname_ex(socket.gethostname())) # print(socket.gethostbyname_ex(socket.gethos)) app.listen(int(config['Server']['port']), socket.gethostbyname(socket.gethostname())) # app.listen(int(config['Server']['port']), "192.168.1.45") print('running server on http://' + socket.gethostbyname(socket.gethostname()) + ':' + config['Server']['port']) IOLoop.instance().start()
def create_app(): config = ConfigParser() config.read('settings.ini') connection.db_url = config['Database']['url'] puerto = config['Server']['port'] vaciar_puerto(puerto) port = int(os.getenv('PORT', puerto)) # if sys.platform == 'win32': # asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) settings = get_settings(config) Thread(target=launch_schedule).start() app = Application(get_handlers(), **settings, default_handler_class=Error404Handler) app.listen(port, config['Server']['address']) print('running server on http://'+config['Server']['address']+':'+config['Server']['port']) #app.listen(int(config['Server']['port']), socket.gethostbyname(socket.gethostname())) #print('running server on http://'+socket.gethostbyname(socket.gethostname())+':'+config['Server']['port']) IOLoop.instance().start()