lemur/lemur/extensions.py

48 lines
833 B
Python
Raw Normal View History

2015-06-22 22:47:27 +02:00
"""
.. module: lemur.extensions
: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.
"""
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()
from flask_migrate import Migrate
2019-05-16 16:57:02 +02:00
2015-06-22 22:47:27 +02:00
migrate = Migrate()
from flask_bcrypt import Bcrypt
2019-05-16 16:57:02 +02:00
2015-06-22 22:47:27 +02:00
bcrypt = Bcrypt()
from flask_principal import Principal
2019-05-16 16:57:02 +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()
from raven.contrib.flask import Sentry
2019-05-16 16:57:02 +02:00
sentry = Sentry()
from blinker import Namespace
2019-05-16 16:57:02 +02:00
signals = Namespace()
from flask_cors import CORS
2019-05-16 16:57:02 +02:00
cors = CORS()