Deema commited on
Commit
f6a8e29
1 Parent(s): 69311a6

Update database.py

Browse files
Files changed (1) hide show
  1. 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="X509-cert-2433626168795922546.pem")
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']