kopia lustrzana https://github.com/glidernet/ogn-python
Added Flask-Profiler
rodzic
c6aed1a105
commit
f8b3457997
|
@ -7,6 +7,7 @@ from flask_migrate import Migrate
|
|||
from flask_caching import Cache
|
||||
from celery import Celery
|
||||
from flask_redis import FlaskRedis
|
||||
from flask_profiler import Profiler
|
||||
|
||||
from config import configs
|
||||
|
||||
|
@ -16,6 +17,7 @@ migrate = Migrate()
|
|||
cache = Cache()
|
||||
redis_client = FlaskRedis()
|
||||
celery = Celery()
|
||||
profiler = Profiler()
|
||||
|
||||
|
||||
def create_app(config_name='default'):
|
||||
|
@ -33,6 +35,7 @@ def create_app(config_name='default'):
|
|||
migrate.init_app(app, db)
|
||||
cache.init_app(app)
|
||||
redis_client.init_app(app)
|
||||
profiler.init_app(app)
|
||||
|
||||
init_celery(app)
|
||||
register_blueprints(app)
|
||||
|
|
11
config.py
11
config.py
|
@ -39,6 +39,17 @@ class DefaultConfig(BaseConfig):
|
|||
#"purge_old_data": {"task": "purge_old_data", "schedule": timedelta(hours=1), "kwargs": {"max_hours": 48}},
|
||||
}
|
||||
|
||||
FLASK_PROFILER = {
|
||||
"enabled": True,
|
||||
"storage": {
|
||||
"engine": "sqlalchemy",
|
||||
"db_url": SQLALCHEMY_DATABASE_URI
|
||||
},
|
||||
"ignore": [
|
||||
"^/static/.*"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
class DevelopmentConfig(BaseConfig):
|
||||
SQLALCHEMY_DATABASE_URI = "postgresql://postgres:postgres@localhost:5432/ogn_test"
|
||||
|
|
1
setup.py
1
setup.py
|
@ -41,6 +41,7 @@ setup(
|
|||
'Flask-Bootstrap==3.3.7.1',
|
||||
'Flask-WTF==0.14.3',
|
||||
'Flask-Caching==1.9.0',
|
||||
'Flask-Profiler==1.8.1',
|
||||
'geopy==2.0.0',
|
||||
'celery==4.4.7',
|
||||
'Flask-Redis==0.4.0',
|
||||
|
|
Ładowanie…
Reference in New Issue