Esempio n. 1
0
def event_history_init():
    EventLogger.init()
    return redirect(url_for("event_history"))
Esempio n. 2
0
log.setLevel(logging.DEBUG)

STREAMS_OUT = ["polyline", "time"]
STREAMS_TO_CACHE = ["polyline", "time"]

sslify = SSLify(app, skips=["webhook_callback"])

# models depend app so we import them afterwards
from models import (Users, Activities, EventLogger, Utility, Webhooks, Index,
                    Payments, db_sql, mongodb, redis)

# initialize MongoDB collections if necessary
collections = mongodb.collection_names()

if "history" not in collections:
    EventLogger.init()

if Activities.name not in collections:
    Activities.init_db()
else:
    Activities.update_ttl()

if Index.name not in collections:
    Index.init_db()
else:
    Index.update_ttl()

if Payments.name not in collections:
    Payments.init_db()

Analytics(app)