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()
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()