-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
37 lines (27 loc) · 815 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from mongomock import MongoClient
import os
class ProdConfig:
MONGODB_USER = os.getenv('MONGODB_USER')
MONGODB_PASSWORD = os.getenv('MONGODB_PASSWORD')
MONGODB_HOST = os.getenv('MONGODB_HOST')
MONGODB_DB = os.getenv('MONGODB_DB')
MONGODB_SETTINGS = {
'host': 'mongodb+srv://%s:%s@%s/%s?retryWrites=true&w=majority' % (
MONGODB_USER,
MONGODB_PASSWORD,
MONGODB_HOST,
MONGODB_DB
)
}
class DevConfig:
MONGODB_SETTINGS = {
'db': os.getenv('MONGODB_DB'),
'host': os.getenv('MONGODB_HOST'),
'username': os.getenv('MONGODB_USERNAME'),
'password': os.getenv('MONGODB_PASSWORD')
}
class MockConfig:
MONGODB_SETTINGS = {
'db': 'users',
'mongo_client_class': MongoClient
}