2015-06-22 13:47:27 -07:00
|
|
|
"""
|
|
|
|
.. module: lemur.extensions
|
2018-05-29 10:18:16 -07:00
|
|
|
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
|
2015-06-22 13:47:27 -07:00
|
|
|
:license: Apache, see LICENSE for more details.
|
|
|
|
"""
|
2018-07-23 10:57:22 -07:00
|
|
|
from flask_sqlalchemy import SQLAlchemy as SA
|
|
|
|
|
|
|
|
|
|
|
|
class SQLAlchemy(SA):
|
|
|
|
def apply_pool_defaults(self, app, options):
|
|
|
|
SA.apply_pool_defaults(self, app, options)
|
|
|
|
options["pool_pre_ping"] = True
|
|
|
|
|
|
|
|
|
2015-06-22 13:47:27 -07:00
|
|
|
db = SQLAlchemy()
|
|
|
|
|
2016-05-05 12:52:08 -07:00
|
|
|
from flask_migrate import Migrate
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2015-06-22 13:47:27 -07:00
|
|
|
migrate = Migrate()
|
|
|
|
|
2016-05-05 12:52:08 -07:00
|
|
|
from flask_bcrypt import Bcrypt
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2015-06-22 13:47:27 -07:00
|
|
|
bcrypt = Bcrypt()
|
|
|
|
|
2016-05-05 12:52:08 -07:00
|
|
|
from flask_principal import Principal
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2017-08-17 19:24:35 +03:00
|
|
|
principal = Principal(use_sessions=False)
|
2015-07-23 13:46:54 -07:00
|
|
|
|
|
|
|
from flask_mail import Mail
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2015-07-23 13:46:54 -07:00
|
|
|
smtp_mail = Mail()
|
2016-04-01 16:54:33 -07:00
|
|
|
|
|
|
|
from lemur.metrics import Metrics
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2016-04-01 16:54:33 -07:00
|
|
|
metrics = Metrics()
|
2017-06-29 14:12:38 -07:00
|
|
|
|
|
|
|
from raven.contrib.flask import Sentry
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2017-06-29 14:12:38 -07:00
|
|
|
sentry = Sentry()
|
2017-08-29 03:35:56 +03:00
|
|
|
|
|
|
|
from blinker import Namespace
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2017-08-29 03:35:56 +03:00
|
|
|
signals = Namespace()
|
2018-04-10 15:55:02 -07:00
|
|
|
|
|
|
|
from flask_cors import CORS
|
2019-05-16 07:57:02 -07:00
|
|
|
|
2018-04-10 15:55:02 -07:00
|
|
|
cors = CORS()
|