def __init__(self): LoggerMixin.configure() db.configure() Compute.configure() APIContainer.configure() JBoxAsyncJob.configure() JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB) self.application = tornado.web.Application(handlers=[ (r"^/", APIInfoHandler), (r"^/.*/.*", APIHandler) ]) self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey') self.application.listen(JBoxCfg.get('api.manager_port'), address=socket.gethostname()) self.application.listen(JBoxCfg.get('api.manager_port'), address='localhost') self.ioloop = ioloop.IOLoop.instance() # run container maintainence every 5 minutes run_interval = 5 * 60 * 1000 self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes") self.ct = ioloop.PeriodicCallback(JBoxAPI.do_housekeeping, run_interval, self.ioloop) self.sigct = ioloop.PeriodicCallback(JBoxAPI.do_signals, 1000, self.ioloop)
def __init__(self): LoggerMixin.configure() db.configure() Compute.configure() SessContainer.configure() VolMgr.configure() JBoxAsyncJob.configure() JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB) self.application = tornado.web.Application(handlers=[ (r"/", MainHandler), (r"/jboxadmin/", AdminHandler), (r"/jboxping/", PingHandler), (r"/jboxcors/", CorsHandler) ]) JBPluginHandler.add_plugin_handlers(self.application) JBPluginUI.create_include_files() # cookie_secret = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in xrange(32)) # use sesskey as cookie secret to be able to span multiple tornado servers self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey') self.application.settings["plugin_features"] = JBox.get_pluggedin_features() self.application.listen(JBoxCfg.get('interactive.manager_port'), address=socket.gethostname()) self.application.listen(JBoxCfg.get('interactive.manager_port'), address='localhost') self.ioloop = tornado.ioloop.IOLoop.instance() # run container maintainence every 5 minutes run_interval = 5 * 60 * 1000 self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes") self.ct = tornado.ioloop.PeriodicCallback(JBox.do_housekeeping, run_interval, self.ioloop) self.sigct = tornado.ioloop.PeriodicCallback(JBox.do_signals, 1000, self.ioloop)
def __init__(self): LoggerMixin.configure() db.configure() Compute.configure() APIContainer.configure() JBoxAsyncJob.configure() JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB) self.application = tornado.web.Application( handlers=[(r"^/", APIInfoHandler), (r"^/.*/.*", APIHandler)]) self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey') self.application.listen(JBoxCfg.get('api.manager_port'), address=socket.gethostname()) self.application.listen(JBoxCfg.get('api.manager_port'), address='localhost') self.ioloop = ioloop.IOLoop.instance() # run container maintainence every 5 minutes run_interval = 5 * 60 * 1000 self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes") self.ct = ioloop.PeriodicCallback(JBoxAPI.do_housekeeping, run_interval, self.ioloop) self.sigct = ioloop.PeriodicCallback(JBoxAPI.do_signals, 1000, self.ioloop)
def create_app(): app = Flask(__name__) views.configure(app) db.configure(app) app.config['SECRET_KEY'] = 'dev' return app
def create_app(): app = Flask( __name__ ) #templates folder sao html e statics javascript/css etc.. se nao informar nada ele pega o nome padrao db.configure(app) views.configure(app) #admin.configure(app) #configurar funçoes #contact.configure(app) #variaveis app.config['SECRET_KEY'] = 'HSUAHSUHAFUUHDHA' return app
def create_app(): app = Flask(__name__) # configurar extensoes db.configure(app) views.configure(app) admin.configure(app) contact.configure(app) # configurar variaveis app.config['SECRET_KEY'] = 'secret' return app
def create_app(): app = Flask(__name__) # configurar extensoes db.configure(app) views.configure(app) contact.configure(app) admin.configure(app) # configurar variaveis app.config['SECRET_KEY'] = 'dhuoel3nbjfop9dh@fmsdkfsml1' return app
def create_app(): app = Flask(__name__, static_folder="static", template_folder="frontend") # Extensions db.configure(app) views.configure(app) admin.configure(app) # Blueprint app example contact.configure(app) # Configurar variaveis app.config["SECRET_KEY"] = "skdalksdjsalkjdlkajsdlkajlks" return app
def create_app(): """Function ?.""" # app = Flask(__name__, template_folder='/template/bar.html', static_folder='/static') app = Flask(__name__) db.configure(app) views.configure(app) # configurar extensões contact.configure(app) # Flask Admin admin.configure(app) # configurar as variáveis app.config['SECRET_KEY'] = 'kdjlkhgslskglg' return app
def __init__(self): LoggerMixin.configure() db.configure() Compute.configure() SessContainer.configure() APIContainer.configure() VolMgr.configure() JBoxAsyncJob.configure() JBoxAsyncJob.init(JBoxAsyncJob.MODE_SUB) self.log_debug("Container manager listening on ports: %s", repr(JBoxCfg.get('container_manager_ports'))) JBoxd.QUEUE = JBoxAsyncJob.get() JBoxd.MAX_ACTIVATIONS_PER_SEC = JBoxCfg.get('user_activation.max_activations_per_sec') JBoxd.MAX_AUTO_ACTIVATIONS_PER_RUN = JBoxCfg.get('user_activation.max_activations_per_run') JBoxd.ACTIVATION_SUBJECT = JBoxCfg.get('user_activation.mail_subject') JBoxd.ACTIVATION_BODY = JBoxCfg.get('user_activation.mail_body') JBoxd.ACTIVATION_SENDER = JBoxCfg.get('user_activation.sender')
def __init__(self): LoggerMixin.configure() db.configure() Compute.configure() SessContainer.configure() VolMgr.configure() JBoxAsyncJob.configure() JBoxAsyncJob.init(JBoxAsyncJob.MODE_PUB) self.application = tornado.web.Application( handlers=[(r"/", MainHandler), ( r"/jboxadmin/", AdminHandler), (r"/jboxping/", PingHandler), (r"/jboxcors/", CorsHandler)]) JBPluginHandler.add_plugin_handlers(self.application) JBPluginUI.create_include_files() # cookie_secret = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in xrange(32)) # use sesskey as cookie secret to be able to span multiple tornado servers self.application.settings["cookie_secret"] = JBoxCfg.get('sesskey') self.application.settings[ "plugin_features"] = JBox.get_pluggedin_features() self.application.listen(JBoxCfg.get('interactive.manager_port'), address=socket.gethostname()) self.application.listen(JBoxCfg.get('interactive.manager_port'), address='localhost') self.ioloop = tornado.ioloop.IOLoop.instance() # run container maintainence every 5 minutes run_interval = 5 * 60 * 1000 self.log_info("Container maintenance every " + str(run_interval / (60 * 1000)) + " minutes") self.ct = tornado.ioloop.PeriodicCallback(JBox.do_housekeeping, run_interval, self.ioloop) self.sigct = tornado.ioloop.PeriodicCallback(JBox.do_signals, 1000, self.ioloop) # or configure cacerts AsyncHTTPClient.configure(None, defaults=dict(validate_cert=None))
def _db(self): db.configure(self) self.save()
def _db(self): db.configure(self)
async def on_ready(): print('Logged in as') print(client.user.name) print(client.user.id) print('------') db.configure()
def create_app(): app = Flask(__name__) views.configure(app) db.configure(app) return app