Add console script with ipython setup

This commit is contained in:
richard-dds 2018-08-06 16:14:20 -04:00
parent 0260feadad
commit b6f14a6c73
2 changed files with 18 additions and 0 deletions

9
ipython_setup.py Normal file
View File

@ -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.")

9
script/console Executable file
View File

@ -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