Ronio Jerico Roque commited on
Commit ·
51fe898
1
Parent(s): 8dccdf2
Add initial application files with login functionality and dependencies
Browse files- .env +2 -0
- app.py +25 -0
- requirements.txt +10 -0
.env
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
email=shore360
|
| 2 |
+
password=shoreai
|
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import os
|
| 3 |
+
from dotenv import load_dotenv
|
| 4 |
+
|
| 5 |
+
# Create an empty container
|
| 6 |
+
placeholder = st.empty()
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
actual_email = os.getenv('email')
|
| 10 |
+
actual_password = os.getenv('password')
|
| 11 |
+
|
| 12 |
+
# Insert a form in the container
|
| 13 |
+
with placeholder.form("login"):
|
| 14 |
+
st.markdown("#### Digital Footprint AI Team")
|
| 15 |
+
email = st.text_input("Email")
|
| 16 |
+
password = st.text_input("Password", type="password")
|
| 17 |
+
submit = st.form_submit_button("Login")
|
| 18 |
+
|
| 19 |
+
if submit and email == actual_email and password == actual_password:
|
| 20 |
+
st.switch_page("pages/home.py")
|
| 21 |
+
st.success("Login successful")
|
| 22 |
+
elif submit and email != actual_email and password != actual_password:
|
| 23 |
+
st.error("Login failed")
|
| 24 |
+
else:
|
| 25 |
+
pass
|
requirements.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
numpy
|
| 2 |
+
pandas
|
| 3 |
+
requests
|
| 4 |
+
streamlit
|
| 5 |
+
python-dotenv
|
| 6 |
+
chardet
|
| 7 |
+
st_img_pastebutton
|
| 8 |
+
streamlit_paste_button
|
| 9 |
+
pymupdf
|
| 10 |
+
pymongo
|