add admin page to manage private data
This commit is contained in:
34
webpages/admin.py
Normal file
34
webpages/admin.py
Normal file
@@ -0,0 +1,34 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user