Browse Source

change db to get_default_database

pull/1/head
songmeo 7 months ago
parent
commit
35cc25848c
  1. 2
      const.py
  2. 5
      main.py

2
const.py

@ -0,0 +1,2 @@
import os
MONGO_URI = os.getenv("MONGO_URI", "mongodb://127.0.0.1:27017/kspace_accounting")

5
main.py

@ -8,9 +8,12 @@ import json
import os
import pymongo
import smtplib
import const
app = Flask(__name__)
mongodb = MongoClient('mongodb://172.21.27.1,172.21.27.2,172.21.27.3:27017/', replicaSet="kspace-mongo-set").kspace_accounting
#mongodb = MongoClient('mongodb://172.21.27.1,172.21.27.2,172.21.27.3:27017/', replicaSet="kspace-mongo-set").kspace_accounting
mongodb = MongoClient(const.MONGO_URI)
mongodb = mongodb.get_default_database()
mongodb.authenticate("kspace_accounting", os.environ["MONGO_PASSWORD"])
DOORBOY_SECRET = os.environ["DOORBOY_SECRET"]

Loading…
Cancel
Save