I'd like to create a script (.sh or python, not important) that can do the following:
heroku pg:reset DATABASE_URL
heroku run python manage.py migrate
heroku run python manage.py shell
> from myapp.scenarios import *; reset_demo_data(); exit()
Line 1 to 3 are UNIX commands, but Line 4 is python to be executed in the opened Django shell.
I tried stuff with | and > to "inject" the python code in the command but nothing worked.
I guess it's quite easy to do but I can't figure out how..
Thanks.