def reloadDB(): print("Start reloading DB") with db.app.app_context(): db.session.query(PDWave).delete() db.session.commit() with curre