Spaces:
Runtime error
Runtime error
Update home.py
Browse files
home.py
CHANGED
@@ -3,20 +3,25 @@ from streamlit_option_menu import option_menu
|
|
3 |
from pymongo import MongoClient
|
4 |
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
|
8 |
def Create_Reminder():
|
9 |
st.title("Create Reminder")
|
10 |
message = st.text_input("What are you planning to do?")
|
11 |
-
time = st.time_input("Time")
|
12 |
-
date = st.date_input("Date")
|
13 |
|
14 |
if st.button("Create Reminder"):
|
15 |
-
|
|
|
16 |
|
17 |
-
if __name__ == "__main__":
|
18 |
-
st.db = MongoClient()
|
19 |
-
dashboard()
|
20 |
|
21 |
|
22 |
|
|
|
3 |
from pymongo import MongoClient
|
4 |
|
5 |
|
6 |
+
uri = os.environ["MONGO_CONNECTION_STRING"]
|
7 |
+
|
8 |
+
client = MongoClient(uri, tlsCertificateKeyFile="database/cert.pem")
|
9 |
+
|
10 |
+
db = client["myapp"]
|
11 |
+
|
12 |
+
col = db["users"]
|
13 |
|
14 |
|
15 |
def Create_Reminder():
|
16 |
st.title("Create Reminder")
|
17 |
message = st.text_input("What are you planning to do?")
|
18 |
+
time = str(st.time_input("Time"))
|
19 |
+
date = str(st.date_input("Date"))
|
20 |
|
21 |
if st.button("Create Reminder"):
|
22 |
+
col.insert_one({"message": message, "time": time, "date": date})
|
23 |
+
st.success("Reminder Created Successfully!")
|
24 |
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
|