Spaces:
Sleeping
Sleeping
Download app.py from mhmdabd/streamlit12: direct link, hf CLI and curl.
- Browser
- Download file 580 Bytes
-
https://huggingface.co/spaces/mhmdabd/streamlit12/resolve/main/app.py
- Command line
-
hf download hf://spaces/mhmdabd/streamlit12/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mhmdabd/streamlit12/resolve/main/app.py
580 Bytes
| import streamlit as st | |
| # Dummy login data (for demo purposes) | |
| USER_CREDENTIALS = { | |
| "admin": "1234", | |
| "user": "abcd" | |
| } | |
| def login_app(): | |
| st.title("๐ Simple Login Page") | |
| # Input fields | |
| username = st.text_input("Username") | |
| password = st.text_input("Password", type="password") | |
| if st.button("Login"): | |
| if username in USER_CREDENTIALS and USER_CREDENTIALS[username] == password: | |
| st.success(f"โ Welcome, {username}!") | |
| else: | |
| st.error("โ Invalid username or password") | |
| if __name__ == "__main__": | |
| login_app() |