Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,9 @@ import os
|
|
7 |
# client = pymongo.MongoClient("mongodb://localhost:27017/")
|
8 |
# db = client["todo_db"]
|
9 |
|
10 |
-
uri = os.environ.get("
|
|
|
|
|
11 |
print(f"uri: {uri}")
|
12 |
# Create a new client and connect to the server
|
13 |
client = pymongo.MongoClient(uri, server_api=ServerApi('1'))
|
|
|
7 |
# client = pymongo.MongoClient("mongodb://localhost:27017/")
|
8 |
# db = client["todo_db"]
|
9 |
|
10 |
+
uri = os.environ.get("user_name", None)
|
11 |
+
uri = os.environ.get("passwd", None)
|
12 |
+
uri = f"mongodb+srv://{user_name}:{passwd}@cluster0.2wsoa5b.mongodb.net/?retryWrites=true&w=majority"
|
13 |
print(f"uri: {uri}")
|
14 |
# Create a new client and connect to the server
|
15 |
client = pymongo.MongoClient(uri, server_api=ServerApi('1'))
|