Spaces:
Sleeping
Sleeping
Fix: Password authentication and deprecated package
Browse filesIssues fixed:
1. Password supports APP_PASSWORD env var (default: demo123)
2. Removed deprecated extra-streamlit-components package
Fixes space crash on startup.
- app.py +2 -1
- requirements.txt +0 -1
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
import matplotlib.pyplot as plt
|
|
@@ -22,7 +23,7 @@ st.set_page_config(
|
|
| 22 |
# Password protection
|
| 23 |
def check_password():
|
| 24 |
def password_entered():
|
| 25 |
-
if st.session_state["password"] == st.secrets
|
| 26 |
st.session_state["password_correct"] = True
|
| 27 |
del st.session_state["password"]
|
| 28 |
else:
|
|
|
|
| 1 |
+
import os
|
| 2 |
import streamlit as st
|
| 3 |
import pandas as pd
|
| 4 |
import matplotlib.pyplot as plt
|
|
|
|
| 23 |
# Password protection
|
| 24 |
def check_password():
|
| 25 |
def password_entered():
|
| 26 |
+
if st.session_state["password"] == st.secrets.get("app_password", os.environ.get("APP_PASSWORD", "demo123")):
|
| 27 |
st.session_state["password_correct"] = True
|
| 28 |
del st.session_state["password"]
|
| 29 |
else:
|
requirements.txt
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
streamlit
|
| 2 |
pandas
|
| 3 |
matplotlib
|
| 4 |
-
extra-streamlit-components
|
| 5 |
streamlit-toggle
|
| 6 |
streamlit-tags
|
| 7 |
streamlit-vertical-slider
|
|
|
|
| 1 |
streamlit
|
| 2 |
pandas
|
| 3 |
matplotlib
|
|
|
|
| 4 |
streamlit-toggle
|
| 5 |
streamlit-tags
|
| 6 |
streamlit-vertical-slider
|