Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,35 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
-
import streamlit_authenticator as stauth
|
3 |
-
import yaml
|
4 |
-
from yaml.loader import SafeLoader
|
5 |
|
|
|
6 |
|
7 |
-
|
8 |
-
with open('./config.yaml') as file:
|
9 |
-
config = yaml.load(file, Loader=SafeLoader)
|
10 |
|
11 |
-
|
12 |
-
# Authenticator setup
|
13 |
-
authenticator = stauth.Authenticate(
|
14 |
-
config['credentials'],
|
15 |
-
config['cookie']['name'],
|
16 |
-
config['cookie']['key'],
|
17 |
-
config['cookie']['expiry_days'],
|
18 |
-
config['preauthorized']
|
19 |
-
)
|
20 |
-
|
21 |
-
name, authentication_status, username = authenticator.login('Login', 'main')
|
22 |
-
|
23 |
-
if authentication_status:
|
24 |
-
st.write(f'Welcome *{name}*')
|
25 |
-
authenticator.logout('Logout', 'sidebar')
|
26 |
-
|
27 |
-
# --- Text Input and Response ---
|
28 |
-
user_text = st.text_input("Enter some text:")
|
29 |
-
if user_text:
|
30 |
-
st.write("Hi!")
|
31 |
-
|
32 |
-
elif authentication_status == False:
|
33 |
-
st.error('Username/password is incorrect')
|
34 |
-
elif authentication_status == None:
|
35 |
-
st.warning('Please enter your username and password')
|
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
2 |
|
3 |
+
st.title("Simple Hi App")
|
4 |
|
5 |
+
user_text = st.text_input("Enter some text:")
|
|
|
|
|
6 |
|
7 |
+
st.write("hi")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|