alfraser commited on
Commit
33de646
·
1 Parent(s): 19f408b

Added secret to bypass login for running the app locally and to speed up development

Browse files
Files changed (1) hide show
  1. src/st_helpers.py +7 -1
src/st_helpers.py CHANGED
@@ -12,7 +12,13 @@ def st_setup(page_title: str, layout: str = 'wide'):
12
  with st.sidebar:
13
  st.image('img/uob-logo.png', width=200)
14
 
15
- logged_in='logged_in'
 
 
 
 
 
 
16
  if logged_in not in st.session_state or st.session_state[logged_in]==False:
17
  _, c2, _ = st.columns(3)
18
  with c2:
 
12
  with st.sidebar:
13
  st.image('img/uob-logo.png', width=200)
14
 
15
+ # Option to add a running_local key to secrets.toml for local login to speed up development
16
+ # This relies on the protection of streamlit secrets in production, which password login already relies on
17
+ running_local = 'running_local'
18
+ if running_local in st.secrets:
19
+ return True
20
+
21
+ logged_in = 'logged_in'
22
  if logged_in not in st.session_state or st.session_state[logged_in]==False:
23
  _, c2, _ = st.columns(3)
24
  with c2: