My project directory ran fine like this:
pages/
-p1.py
-p2.py
app.py
utils.py # secret accessed here using os.getenv
And had trouble after changing to:
devapp/
pages/
-p1.py
-p2.py
app.py
tools/
-utils.py # secret accessed here using os.getenv
I tried storing secrets in heroku and .streamlit/secrets.toml
.
Note: to get relative imports to work i.e. from tools.utils import func
I had to run it using python -m streamlit run devapp/app.py