def init_db(): with app.app_context(): db = get_db() with app.open_resource('schema.sql', mode='r') as f: db.cursor().executescript(f.read()) db.commit()
from charlotte import app from charlotte.database import init_db with app.app_context(): init_db()