2015-06-22 22:47:27 +02:00
|
|
|
"""
|
|
|
|
.. module: lemur.extensions
|
2018-05-29 19:18:16 +02:00
|
|
|
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
|
2015-06-22 22:47:27 +02:00
|
|
|
:license: Apache, see LICENSE for more details.
|
|
|
|
"""
|
2018-07-23 19:57:22 +02: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 22:47:27 +02:00
|
|
|
db = SQLAlchemy()
|
|
|
|
|
2016-05-05 21:52:08 +02:00
|
|
|
from flask_migrate import Migrate
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2015-06-22 22:47:27 +02:00
|
|
|
migrate = Migrate()
|
|
|
|
|
2016-05-05 21:52:08 +02:00
|
|
|
from flask_bcrypt import Bcrypt
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2015-06-22 22:47:27 +02:00
|
|
|
bcrypt = Bcrypt()
|
|
|
|
|
2016-05-05 21:52:08 +02:00
|
|
|
from flask_principal import Principal
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2017-08-17 18:24:35 +02:00
|
|
|
principal = Principal(use_sessions=False)
|
2015-07-23 22:46:54 +02:00
|
|
|
|
|
|
|
from flask_mail import Mail
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2015-07-23 22:46:54 +02:00
|
|
|
smtp_mail = Mail()
|
2016-04-02 01:54:33 +02:00
|
|
|
|
|
|
|
from lemur.metrics import Metrics
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2016-04-02 01:54:33 +02:00
|
|
|
metrics = Metrics()
|
2017-06-29 23:12:38 +02:00
|
|
|
|
|
|
|
from raven.contrib.flask import Sentry
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2017-06-29 23:12:38 +02:00
|
|
|
sentry = Sentry()
|
2017-08-29 02:35:56 +02:00
|
|
|
|
|
|
|
from blinker import Namespace
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2017-08-29 02:35:56 +02:00
|
|
|
signals = Namespace()
|
2018-04-11 00:55:02 +02:00
|
|
|
|
|
|
|
from flask_cors import CORS
|
2019-05-16 16:57:02 +02:00
|
|
|
|
2018-04-11 00:55:02 +02:00
|
|
|
cors = CORS()
|