-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_up.py
29 lines (27 loc) · 1.1 KB
/
login_up.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import streamlit as st
def app():
st.title("ST PETERS CLAVERS SECONDARY SCHOOL WEBSITE")
st.subheader("login")
menu = ["Home", "About", "Blog"]
choice = st.sidebar.selectbox("Select a page", menu)
if choice == "Home":
st.write("Welcome to the login page!")
username = st.text_input("Username")
password = st.text_input("Password", type="password")
if st.button("Login"):
if username == "admin" and password == "password":
st.success("Logged in as admin.")
else:
st.error("Invalid username or password.")
st.write("Don't have an account? Register below.")
new_username = st.text_input("New username")
new_password = st.text_input("New password", type="password")
if st.button("Register"):
# Add code to register new user
st.success(f"User {new_username} registered successfully!")
elif choice == "About":
st.write("This is the about page.")
elif choice == "Blog":
st.write("This is the blog page.")
if __name__ == "__main__":
app()