change db to get_default_database
This commit is contained in:
parent
33f3e6171c
commit
35cc25848c
2
const.py
Normal file
2
const.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import os
|
||||||
|
MONGO_URI = os.getenv("MONGO_URI", "mongodb://127.0.0.1:27017/kspace_accounting")
|
5
main.py
5
main.py
@ -8,9 +8,12 @@ import json
|
|||||||
import os
|
import os
|
||||||
import pymongo
|
import pymongo
|
||||||
import smtplib
|
import smtplib
|
||||||
|
import const
|
||||||
|
|
||||||
app = Flask(__name__)
|
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"])
|
mongodb.authenticate("kspace_accounting", os.environ["MONGO_PASSWORD"])
|
||||||
|
|
||||||
DOORBOY_SECRET = os.environ["DOORBOY_SECRET"]
|
DOORBOY_SECRET = os.environ["DOORBOY_SECRET"]
|
||||||
|
Loading…
Reference in New Issue
Block a user