[Feed] init

This commit is contained in:
tmshv committed 2017-04-22 01:33:05 +03:00
1 parent 5da1572589
commit 07b03154da
7 files changed
+108

No files matched your search

+13
View File
@@ -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]