Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
import json
|
3 |
from streamlit_option_menu import option_menu
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
def loadfile():
|
6 |
-
with open("database/data.json") as file:
|
7 |
-
data = json.load(file)
|
8 |
-
return data
|
9 |
|
10 |
-
def savefile(newuser):
|
11 |
-
data = loadfile()
|
12 |
-
usrdata = data['reminders']
|
13 |
-
usrdata.append(newuser)
|
14 |
-
with open("database/data.json", "w") as f:
|
15 |
-
json.dump(data, f, indent=4)
|
16 |
|
17 |
def Signup():
|
18 |
username = st.text_input("Username")
|
@@ -24,7 +20,7 @@ def Signup():
|
|
24 |
}
|
25 |
if st.button("Signup"):
|
26 |
if password == confpass:
|
27 |
-
|
28 |
st.write("You are Registered Sucessfully")
|
29 |
else:
|
30 |
"Password do not match"
|
|
|
1 |
import streamlit as st
|
2 |
import json
|
3 |
from streamlit_option_menu import option_menu
|
4 |
+
from pymongo import MongoClient
|
5 |
+
import os
|
6 |
+
|
7 |
+
uri = os.environ["MONGO_CONNECTION_STRING"]
|
8 |
+
|
9 |
+
|
10 |
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
def Signup():
|
14 |
username = st.text_input("Username")
|
|
|
20 |
}
|
21 |
if st.button("Signup"):
|
22 |
if password == confpass:
|
23 |
+
col.insert_one({"username": username, "password": password})
|
24 |
st.write("You are Registered Sucessfully")
|
25 |
else:
|
26 |
"Password do not match"
|