-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
57 lines (42 loc) · 1.26 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
"""Flask config."""
from os import environ
from dotenv import load_dotenv
load_dotenv(".env")
class Config:
"""Base config"""
SECRET_KEY = environ.get("SECRET")
WTF_CSRF_SECRET_KEY = environ.get("SECRET")
SALT_EMAIL = environ.get("SALT_EMAIL")
STATIC_FOLDER = "static"
TEMPLATES_FOLDER = "templates"
# Database
DATABASE_URI = environ.get("DATABASE_URL")
SQLALCHEMY_DATABASE_URI = environ.get("DATABASE_URL")
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENGINE_OPTIONS = {
"pool_recycle": 280,
"pool_timeout": 100,
"pool_pre_ping": True,
}
# Email (TSL errors out)
MAIL_SERVER = "smtp.gmail.com"
MAIL_PORT = 465 # for TSL use 587, for ssl use 465
MAIL_USE_TSL = False
MAIL_USE_SSL = True
MAIL_USERNAME = environ.get("MAIL_USERNAME")
MAIL_PASSWORD = environ.get("MAIL_PASSWORD")
MAIL_SUPPRESS_SEND = False
ADMINS = ["[email protected]"]
class ProdConfig(Config):
"""Production config"""
FLASK_ENV = "production"
DEBUG = False
TESTING = False
WTF_CSRF_ENABLED = True
class DevConfig(Config):
"""Development config"""
FLASK_ENV = "development"
DEBUG = True
TESTING = True
WTF_CSRF_ENABLED = False
# eof