diff --git a/ipython_setup.py b/ipython_setup.py new file mode 100644 index 00000000..125a3d2b --- /dev/null +++ b/ipython_setup.py @@ -0,0 +1,9 @@ +from atst.app import make_config, make_app +from atst.database import db +from atst.models import * + +app = make_app(make_config()) +ctx = app.app_context() +ctx.push() + +print("\nWelcome to atst. This shell has all models in scope, and a SQLAlchemy session called db.") diff --git a/script/console b/script/console new file mode 100755 index 00000000..0561ac99 --- /dev/null +++ b/script/console @@ -0,0 +1,9 @@ +#!/bin/bash + +# If a command fails, exit the script +set -e + +# Ensure we are in the app root directory (not the /script directory) +cd "$(dirname "${0}")/.." + +pipenv run ipython -i ./ipython_setup.py