Example #1
0
def drop_db():
    """Initialize database"""
    from factory import db, app
    app = create_app('default')
    app_context = app.app_context()
    app_context.push()
    db.drop_all()
    app_context.pop()
Example #2
0
def init_db():
    """Initialize database"""
    from factory import db, app
    app = create_app('default')
    app_context = app.app_context()
    app_context.push()
    db.create_all()
    from catalog.init_db import database_init
    x = database_init.fill_examples
    x()
    app_context.pop()