Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,34 +1,50 @@
|
|
1 |
import streamlit as st
|
2 |
-
from streamlit_option_menu import option_menu
|
3 |
-
import os
|
4 |
-
|
5 |
-
from
|
6 |
-
from
|
|
|
7 |
|
8 |
-
load_dotenv()
|
9 |
|
10 |
-
uri = os.environ["MONGO_CONNECTION_STRING"]
|
11 |
|
12 |
-
# Create a new client and connect to the server
|
13 |
-
client = MongoClient(uri, ssl=False, server_api=ServerApi('1'), tls=False)
|
14 |
|
15 |
-
db = client["myapp"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
col = db["users"]
|
18 |
|
19 |
-
newuser = {
|
20 |
-
"username": "John",
|
21 |
-
"password": "sdgsg"
|
22 |
-
}
|
23 |
|
24 |
-
col.insert_one(newuser)
|
25 |
-
print("done!")
|
26 |
|
27 |
-
# Send a ping to confirm a successful connection
|
28 |
-
try:
|
29 |
-
client.admin.command('ping')
|
30 |
-
print("Pinged your deployment. You successfully connected to MongoDB!")
|
31 |
-
except Exception as e:
|
32 |
-
print(e)
|
33 |
|
34 |
-
option_menu(None, ["Home", "About Us", "Logout"], orientation="horizontal")
|
|
|
1 |
import streamlit as st
|
2 |
+
# from streamlit_option_menu import option_menu
|
3 |
+
# import os
|
4 |
+
import pandas as pd
|
5 |
+
# from pymongo.mongo_client import MongoClient
|
6 |
+
# from dotenv import load_dotenv
|
7 |
+
# from pymongo.server_api import ServerApi
|
8 |
|
9 |
+
# load_dotenv()
|
10 |
|
11 |
+
# uri = os.environ["MONGO_CONNECTION_STRING"]
|
12 |
|
13 |
+
# # Create a new client and connect to the server
|
14 |
+
# client = MongoClient(uri, ssl=False, server_api=ServerApi('1'), tls=False)
|
15 |
|
16 |
+
# db = client["myapp"]
|
17 |
+
|
18 |
+
# col = db["users"]
|
19 |
+
|
20 |
+
# newuser = {
|
21 |
+
# "username": "John",
|
22 |
+
# "password": "sdgsg"
|
23 |
+
# }
|
24 |
+
|
25 |
+
# col.insert_one(newuser)
|
26 |
+
# print("done!")
|
27 |
+
|
28 |
+
# # Send a ping to confirm a successful connection
|
29 |
+
# try:
|
30 |
+
# client.admin.command('ping')
|
31 |
+
# print("Pinged your deployment. You successfully connected to MongoDB!")
|
32 |
+
# except Exception as e:
|
33 |
+
# print(e)
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
# option_menu(None, ["Login", "SignUp"], orientation="horizontal")
|
38 |
+
|
39 |
+
|
40 |
+
with open("data.json")as f:
|
41 |
+
data = json.load(f)
|
42 |
+
|
43 |
+
df = pd.Dataframe(data["reminders"])
|
44 |
+
|
45 |
+
df
|
46 |
|
|
|
47 |
|
|
|
|
|
|
|
|
|
48 |
|
|
|
|
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
|