Files
Buffteks-Website/webpages/admin.py
2025-10-13 23:50:53 -05:00

35 lines
1015 B
Python

import streamlit as st
import pandas as pd
import streamlit_authenticator as stauth
from webpages.buffteks_authenticator import load_authenticator
from webpages.adminpages.helloween_image import camera_photo
def admin():
try:
authenticator = load_authenticator()
authenticator.login()
except Exception as e:
st.error(e)
if st.session_state.get('authentication_status') is False:
st.error('Username/password is incorrect')
elif st.session_state.get('authentication_status') is None:
st.warning('Please enter your username and password')
if st.session_state.get('authentication_status'):
authenticator.logout()
st.header(f'Welcome *{st.session_state.get("name")}*')
st.divider()
with st.expander("Check Memberships"):
new_members = pd.read_json("new_members.json")
st.dataframe(new_members)
st.divider()
camera_photo()