Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,8 @@ uri = os.environ["MONGO_CONNECTION_STRING"]
|
|
| 13 |
|
| 14 |
client = MongoClient(uri, tlsCertificateKeyFile="cert.pem")
|
| 15 |
|
| 16 |
-
db = client[""]
|
|
|
|
| 17 |
|
| 18 |
def login():
|
| 19 |
st.title("Login")
|
|
@@ -41,15 +42,13 @@ def signup():
|
|
| 41 |
confirm_password = st.text_input("Confirm Password", type="password")
|
| 42 |
if st.button("Signup", key="signupkey"):
|
| 43 |
if password == confirm_password:
|
| 44 |
-
|
| 45 |
newuser = {
|
| 46 |
"username": username,
|
| 47 |
-
"password": password
|
| 48 |
-
|
| 49 |
}
|
| 50 |
-
|
| 51 |
-
with open("database/data.json", "w") as file:
|
| 52 |
-
json.dump(data, file)
|
| 53 |
st.success("Account created")
|
| 54 |
else:
|
| 55 |
st.error("Passwords do not match")
|
|
|
|
| 13 |
|
| 14 |
client = MongoClient(uri, tlsCertificateKeyFile="cert.pem")
|
| 15 |
|
| 16 |
+
db = client["reshav"]
|
| 17 |
+
col=db["mine"]
|
| 18 |
|
| 19 |
def login():
|
| 20 |
st.title("Login")
|
|
|
|
| 42 |
confirm_password = st.text_input("Confirm Password", type="password")
|
| 43 |
if st.button("Signup", key="signupkey"):
|
| 44 |
if password == confirm_password:
|
| 45 |
+
|
| 46 |
newuser = {
|
| 47 |
"username": username,
|
| 48 |
+
"password": password
|
| 49 |
+
|
| 50 |
}
|
| 51 |
+
col.insert_one(newuser)
|
|
|
|
|
|
|
| 52 |
st.success("Account created")
|
| 53 |
else:
|
| 54 |
st.error("Passwords do not match")
|