Although run.sh implicitly sources ENV.sh; after creating the ENV.sh file during the initial setup, users need to source it before calling init_db.py script. Otherwise, the init_db.py complains about the missing DB variable:
# initial setup
(venv)arman@narnia cycledash > make initenv
Creating ENV template...
ENV.sh created, edit it to configure CycleDash.
# this fails
(venv)arman@narnia cycledash > python scripts/init_db.py
No $DATABASE_URI found; make sure to source your environment file!
# and this succeeds
(venv)arman@narnia cycledash > source ENV.sh
(venv)arman@narnia cycledash > python scripts/init_db.py
Are you sure you want to initialize the Cycledash database in postgres:///cycledash? (y/n): y
INFO [alembic.migration] Context impl PostgresqlImpl.
INFO [alembic.migration] Will assume transactional DDL.
Created Cycledash DB and stamped with most recent migration!
...
Although
run.sh
implicitly sourcesENV.sh
; after creating theENV.sh
file during the initial setup, users need to source it before callinginit_db.py
script. Otherwise, theinit_db.py
complains about the missing DB variable: