Michael Rey commited on
Commit
43803c8
·
1 Parent(s): d4c2f90
Files changed (1) hide show
  1. src/streamlit_app.py +5 -3
src/streamlit_app.py CHANGED
@@ -3,12 +3,14 @@ import sys
3
 
4
  # 1. Tell Streamlit to read config from our root folder
5
  os.environ["STREAMLIT_CONFIG_FILE"] = os.path.abspath(
6
- os.path.join(os.path.dirname(__file__), "../.streamlit/config.toml")
7
  )
8
 
9
  # 2. Redirect all Streamlit writes to /tmp
10
- for var in ["STREAMLIT_HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME"]:
11
- os.environ[var] = "/tmp"
 
 
12
 
13
  # 3. Ensure imports work by adding root to path
14
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
 
3
 
4
  # 1. Tell Streamlit to read config from our root folder
5
  os.environ["STREAMLIT_CONFIG_FILE"] = os.path.abspath(
6
+ os.path.join(os.path.dirname(__file__), ".streamlit/config.toml")
7
  )
8
 
9
  # 2. Redirect all Streamlit writes to /tmp
10
+ os.environ["HOME"] = "/tmp"
11
+ os.environ["STREAMLIT_HOME"] = "/tmp"
12
+ os.environ["XDG_CONFIG_HOME"] = "/tmp"
13
+ os.environ["XDG_CACHE_HOME"] = "/tmp"
14
 
15
  # 3. Ensure imports work by adding root to path
16
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))