-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
43 lines (34 loc) · 1.29 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
from decouple import config
DATABASE_URI = config("DATABASE_URL")
if DATABASE_URI.startswith("postgres://"):
DATABASE_URI = DATABASE_URI.replace("postgres://", "postgresql://", 1)
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = config("SECRET_KEY", default="guess-me-not")
SECURITY_PASSWORD_SALT=config("SECURITY_PASSWORD_SALT", default="too-salty")
MAILJET_API_KEY=config("MAILJET_API_KEY", default="mailjet-api-key")
MAILJET_API_SECRET=config("MAILJET_API_SECRET", default="mailjet-api-secret")
EMAIL_SENDER=config("EMAIL_SENDER", default="info@example.com")
EMAIL_SENDER_NAME=config("EMAIL_SENDER_NAME", default="ADEF Team")
MAX_CONTENT_LENGTH = 24 * 1000 * 1000
SQLALCHEMY_DATABASE_URI = DATABASE_URI
SQLALCHEMY_TRACK_MODIFICATIONS = False
WTF_CSRF_ENABLED = True
DEBUG_TB_ENABLED = False
DEBUG_TB_INTERCEPT_REDIRECTS = False
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
WTF_CSRF_ENABLED = False
DEBUG_TB_ENABLED = True
class TestingConfig(Config):
TESTING = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///testdb.sqlite"
BCRYPT_LOG_ROUNDS = 1
WTF_CSRF_ENABLED = False
class ProductionConfig(Config):
DEBUG = False
DEBUG_TB_ENABLED = False