Example #1
0
def app_init():
    info = {Activities.init_db(), Index.init_db(), Payments.init_db()}
    return "Activities, Index, Payments databases re-initialized"
Example #2
0
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)


def parseInt(s):