forked from raphattack/espn-ffb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
61 lines (46 loc) · 1.59 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
def get_db_uri(user, password, host, port, dbname):
return f"postgresql://{user}:{password}@{host}:{port}/{dbname}"
# return f"mysql://{user}:{password}@{host}:{port}/{dbname}"
# return f"oracle://{user}:{password}@{host}:{port}/{dbname}"
class Config(object):
LEAGUE_ID = 123456
CURRENT_YEAR = 2019
DB_URI = ""
COOKIES = {
"swid": "{your_swid}",
"espn_s2": "your_espn_s2"
}
config_dir = "/etc/opt/espn-ffb"
log_base_dir = "/var/log/espn-ffb"
log_format = "%(asctime)s %(levelname)s %(pathname)s %(lineno)d: %(message)s"
log_interval = 1
console_level = 20
rootlogger_level = 10
filelog_level = 20
log_backup_count = 90
log_when = "midnight"
class DevConfig(Config):
config_dir = "conf"
log_base_dir = "log"
# console_level = 10
dbname = "your_dev_db"
user = "your_dev_user"
password = "your_dev_pw"
host = "localhost"
port = "5432"
DB_URI = get_db_uri(user=user, password=password, host=host, port=port, dbname=dbname)
class DockerConfig(Config):
dbname = os.getenv('POSTGRES_DB')
user = os.getenv('POSTGRES_USER')
password = os.getenv('POSTGRES_PASSWORD')
host = os.getenv('POSTGRES_HOST')
port = os.getenv('POSTGRES_PORT')
DB_URI = get_db_uri(user=user, password=password, host=host, port=port, dbname=dbname)
class ProdConfig(Config):
dbname = "your_prod_db"
user = "your_prod_user"
password = "your_prod_pw"
host = "localhost"
port = "5432"
DB_URI = get_db_uri(user=user, password=password, host=host, port=port, dbname=dbname)