How to change the default location of .streamlit folder

I am deploying a streamlit app to a read-only folder (due to certain restrictions in how the environment is set). any other folders above that folder are writable, just the www/root one where the streamlit app is deployed is read-only.

This means that I need to find a way to create .streamlit folder somewhere else.

Are there any settings that I can do from app.py to make this happen?

Also, the url the exposes this app is configured through reverse proxy because the env I am in does not have direct connection to the internet. I think that is why I am geeting the error: โ€œDid not auto detect external IPโ€

the external URL is not displayed as well. I tried setting โ€œโ€“server.headless=falseโ€ in the startup command but that didnโ€™t work.

You could probably use:

  1. The global .streamlit folder created under the home folder of the user account that Streamlit was installed, if that is writeable by your user account
  2. Create your own .toml settings file and use the toml python package to read it.
  3. Create a .env file and use dotenv to load it into the environment.

With headless being false, your app will try to open a browser on the machine that it is running in. If youโ€™re expecting to connect to the app from the outside, then headless should be true.