[Feed] init
This commit is contained in:
1 parent
5da1572589
commit
07b03154da
7 files changed
+108
No files matched your search
@@ -0,0 +1,13 @@
|
||||
from pymongo import MongoClient
|
||||
from settings import db_uri, db_name, db_user, db_password
|
||||
|
||||
db = MongoClient(db_uri)[db_name]
|
||||
if db_user and db_password:
|
||||
auth_status = db.authenticate(db_user, db_password)
|
||||
if not auth_status:
|
||||
print('Failed to authenticate user')
|
||||
exit(1)
|
||||
|
||||
|
||||
def collection(name):
|
||||
return db[name]
|
||||
Reference in new issue
Block a user