Update Auth.py
Browse files
Auth.py
CHANGED
|
@@ -8,6 +8,19 @@ import pymongo
|
|
| 8 |
st.page_config(page_title="Auth", page_icon=":lock:")
|
| 9 |
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
def loadfile():
|
|
|
|
| 8 |
st.page_config(page_title="Auth", page_icon=":lock:")
|
| 9 |
|
| 10 |
|
| 11 |
+
from pymongo.mongo_client import MongoClient
|
| 12 |
+
|
| 13 |
+
uri = "mongodb+srv://new-userr:thispassword@cluster0.nfkbemi.mongodb.net/?retryWrites=true&w=majority"
|
| 14 |
+
|
| 15 |
+
# Create a new client and connect to the server
|
| 16 |
+
client = MongoClient(uri)
|
| 17 |
+
|
| 18 |
+
# Send a ping to confirm a successful connection
|
| 19 |
+
try:
|
| 20 |
+
client.admin.command('ping')
|
| 21 |
+
print("Pinged your deployment. You successfully connected to MongoDB!")
|
| 22 |
+
except Exception as e:
|
| 23 |
+
print(e)
|
| 24 |
|
| 25 |
|
| 26 |
def loadfile():
|