def __init__(self): if hasattr(settings, 'BLUEOX_HOST'): if settings.BLUEOX_HOST: blueox.default_configure(settings.BLUEOX_HOST) else: blueox.configure(None, None) else: blueox.default_configure()
def on_worker_process_init(**kwargs): if hasattr(settings, 'BLUEOX_HOST'): if settings.BLUEOX_HOST: blueox.default_configure(settings.BLUEOX_HOST) else: blueox.configure(None, None) else: blueox.default_configure()
def __init__(self, app): self.app = app if 'BLUEOX_HOST' in app.config: self.blueox_host = app.config['BLUEOX_HOST'] if self.blueox_host: blueox.default_configure(self.blueox_host) else: blueox.default_configure() self.app.before_request(self.before_request) self.app.after_request(self.after_request) got_request_exception.connect(self.handle_exception, self.app)