-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
46 lines (34 loc) · 1.39 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
import os
from datetime import timedelta
# Determine the folder of the top-level directory of this project
BASEDIR = os.path.abspath(os.path.dirname(__file__))
class Config(object):
FLASK_ENV = 'development'
DEBUG = False
TESTING = False
SECRET_KEY = os.getenv('SECRET_KEY', default='BAD_SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL',
default=f"sqlite:///{os.path.join(BASEDIR, 'instance', 'app.db')}")
SQLALCHEMY_TRACK_MODIFICATIONS = False
BCRYPT_LOG_ROUNDS = 15
WTF_CSRF_ENABLED = True
REMEMBER_COOKIE_DURATION = timedelta(days=14)
# Flask-Mail Configuration
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = os.getenv('MAIL_USERNAME', default='')
MAIL_PASSWORD = os.getenv('MAIL_PASSWORD', default='')
MAIL_DEFAULT_SENDER = os.getenv('MAIL_USERNAME', default='')
ALPHA_VANTAGE_API_KEY = os.getenv('ALPHA_VANTAGE_API_KEY', default='')
class ProductionConfig(Config):
FLASK_ENV = 'production'
class DevelopmentConfig(Config):
DEBUG = True
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = os.getenv('TEST_DATABASE_URI',
default=f"sqlite:///{os.path.join(BASEDIR, 'instance', 'test.db')}")
BCRYPT_LOG_ROUNDS = 4
WTF_CSRF_ENABLED = False