Hello,
I'm having problems posting a shiny for python app that makes use of environment variables passed in using the rsconnect CLI following the help documentation. The deployment concludes with no errors, but when I view the app it says "The application failed to start", and I can see from the logs that none of the environment variables made it to shinyapps.io. Is this possible to do? If so, can someone help me figure out if I'm doing something wrong?
I have a Shiny for Python app that I'm trying to deploy to my personal (free tier) shinyapps.io account that tracks my music practice sessions so I can share them with my teacher. The app connects to a postgres database hosted on the cloud and I store the credential information in virtual environment environment variables (pg_schema, pg_host, pg_user, etc). Locally this works fine and my app uses code like os.environ['pg_schema'] to access the environment variables.
For my deployment step I first create my own requirements.txt file and use that to write a manifest.json. Then I use the following command to deploy:
rsconnect deploy shiny --new data_entry_app/ --name shinyapps-io --title "test_db_app_pg" -E pg_user=$pg_user -E pg_pw=$pg_pw -E pg_host=$pg_host -E pg_port=$pg_port -E pg_dbname=$pg_dbname -E pg_schema=$pg_schema
I've also tried this by removing the assignment of each env var in the rsconnect deploy step (-E pg_user -E pg_pw -E pg_host etc...) but the result is the same.
I appreciate any guidance from the community on this. Thanks!