Spaces:
Runtime error
Runtime error
Update database.py
Browse files- database.py +4 -1
database.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
from pymongo import MongoClient
|
|
|
|
|
|
|
2 |
|
3 |
uri = "mongodb+srv://cluster0.tzvxqk3.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority"
|
4 |
client = MongoClient(uri,
|
5 |
tls=True,
|
6 |
-
tlsCertificateKeyFile=
|
7 |
|
8 |
db = client['testDB']
|
9 |
collection = db['testCol']
|
|
|
1 |
from pymongo import MongoClient
|
2 |
+
import os
|
3 |
+
|
4 |
+
CER_KEY = os.environ['cer']
|
5 |
|
6 |
uri = "mongodb+srv://cluster0.tzvxqk3.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority"
|
7 |
client = MongoClient(uri,
|
8 |
tls=True,
|
9 |
+
tlsCertificateKeyFile=CER_KEY)
|
10 |
|
11 |
db = client['testDB']
|
12 |
collection = db['testCol']
|