-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
48 lines (37 loc) · 1.2 KB
/
config.py
File metadata and controls
48 lines (37 loc) · 1.2 KB
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
import os
from decouple import config
class Config:
SQLALCHEMY_ECHO = True
SECRET_KEY = config("SECRET_KEY")
MAIL_SERVER = 'smtp.office365.com'
MAIL_PORT = 587
MAIL_USERNAME = "alerts@chc.capital"
MAIL_PASSWORD = config("SMTP_PASSWORD_ALERTS")
MAIL_DEFAULT_SENDER = ("TrdBot Alerts", "alerts@chc.capital")
MAIL_USE_SSL = False
MAIL_USE_TLS = True
MAIL_DEBUG = False
# SQLALCHEMY_ENGINE_OPTIONS = {
# "pool_pre_ping": True,
# "pool_recycle": 300,
# }
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = config("DATABASE_URL")
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
class TestingConfig(Config):
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = config("DATABASE_URL")
PRESERVE_CONTEXT_ON_EXCEPTION = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = False
class ProductionConfig(Config):
DEBUG = False
SQLALCHEMY_DATABASE_URI = config("DATABASE_URL")
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
config = dict(development=DevelopmentConfig,
test=TestingConfig,
production=ProductionConfig)