def __init__(self): handlers = [ (r'/', WebHandler), (r'/ws', SocketHandler), ] settings = dict( title='Tornado Poker', cookie_secret='fiDSpuZ7QFe8fm0XP9Jb7ZIPNsOegkHYtgKSd4I83Hs=', template_path=os.path.join(BASE_DIR, 'static'), static_path=os.path.join(BASE_DIR, 'static'), login_url='/', xsrf_cookies=True, debug=True, ) super(Application, self).__init__(handlers, **settings) self.db = torndb.Connection( host='localhost', database='ddz', user='******', password='******') self.executor = ThreadPoolExecutor()
def __init__(self): handlers = [ (r'/', WebHandler), (r'/update', UpdateHandler), (r'/reg', RegHandler), (r'/ws', SocketHandler), ] settings = dict( title='Tornado Poker', cookie_secret='fiDSpuZ7QFe8fm0XP9Jb7ZIPNsOegkHYtgKSd4I83Hs=', template_path=os.path.join(BASE_DIR, 'static'), static_path=os.path.join(BASE_DIR, 'static'), login_url='/', xsrf_cookies=True, debug=True, ) tornado.options.parse_config_file("server.conf") super(Application, self).__init__(handlers, **settings) self.db = torndb.Connection(host=options.host, database=options.database, user=options.user, password=options.password) self.executor = ThreadPoolExecutor()
def __init__(self): super().__init__(url_patterns, **settings) self.db = torndb.Connection(**DATABASE) self.executor = ThreadPoolExecutor()