Spaces:
Build error
Build error
Update app.py
#1
by
CosmoAI
- opened
app.py
CHANGED
|
@@ -3,25 +3,32 @@ from home import dashboard
|
|
| 3 |
from streamlit_option_menu import option_menu
|
| 4 |
import json
|
| 5 |
import uuid
|
|
|
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
st.set_page_config(page_title="Authentication", page_icon=":guardsman:", layout="wide")
|
| 9 |
|
| 10 |
# st.title("Authentication")
|
| 11 |
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
-
def save_json():
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
|
| 27 |
|
|
|
|
| 3 |
from streamlit_option_menu import option_menu
|
| 4 |
import json
|
| 5 |
import uuid
|
| 6 |
+
from pymongo import MongoClient
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
|
| 10 |
st.set_page_config(page_title="Authentication", page_icon=":guardsman:", layout="wide")
|
| 11 |
|
| 12 |
# st.title("Authentication")
|
| 13 |
|
| 14 |
+
uri = os.environ["MONGO_CONNECTION_STRING"]
|
| 15 |
|
| 16 |
+
client = MongoClient(uri, tlsCertificateKeyFile="cert.pem")
|
| 17 |
+
|
| 18 |
+
db = client[""]
|
| 19 |
+
|
| 20 |
+
# def load_json():
|
| 21 |
+
# with open("database/data.json") as file:
|
| 22 |
+
# data = json.load(file)
|
| 23 |
+
# return data
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
+
# def save_json():
|
| 30 |
+
# with open("database/data.json", "w") as file:
|
| 31 |
+
# json.dump( file, indent=4)
|
| 32 |
|
| 33 |
|
| 34 |
|