2019-07-03 08:31:23 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
2019-07-05 12:47:35 +00:00
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
|
2019-07-03 08:31:23 +00:00
|
|
|
class Config:
|
2019-08-13 12:10:50 +00:00
|
|
|
JOBS = [
|
|
|
|
{
|
2019-08-13 12:27:02 +00:00
|
|
|
'id': 'checkout_jobs',
|
|
|
|
'func': 'app.scheduler_functions:checkout_jobs',
|
2019-08-13 12:10:50 +00:00
|
|
|
'seconds': 3,
|
|
|
|
'trigger': 'interval'
|
|
|
|
}
|
|
|
|
]
|
2019-07-08 11:55:13 +00:00
|
|
|
MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.gmail.com')
|
2019-07-08 09:29:11 +00:00
|
|
|
MAIL_PORT = int(os.environ.get('MAIL_PORT', '587'))
|
|
|
|
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS', 'true').lower() in \
|
|
|
|
['true', 'on', '1']
|
|
|
|
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
|
|
|
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
2019-07-09 13:41:16 +00:00
|
|
|
OPAQUE_ADMIN = os.environ.get('OPAQUE_ADMIN')
|
2019-08-05 06:36:11 +00:00
|
|
|
OPAQUE_STORAGE = os.environ.get('OPAQUE_STORAGE')
|
2019-07-08 09:29:11 +00:00
|
|
|
OPAQUE_MAIL_SUBJECT_PREFIX = '[Opaque]'
|
2019-07-08 11:55:13 +00:00
|
|
|
OPAQUE_MAIL_SENDER = 'Opaque Development <dev.opaque@gmail.com>'
|
2019-07-03 08:31:23 +00:00
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
|
2019-07-05 12:47:35 +00:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
2019-07-03 13:40:09 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def init_app(app):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
|
|
DEBUG = True
|
2019-07-05 12:47:35 +00:00
|
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data_dev.sqlite')
|
2019-07-03 13:40:09 +00:00
|
|
|
|
|
|
|
|
2019-07-08 08:52:36 +00:00
|
|
|
class TestingConfig(Config):
|
|
|
|
TESTING = True
|
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
|
|
|
|
'sqlite://'
|
|
|
|
WTF_CSRF_ENABLED = False
|
2019-07-03 13:40:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
# class ProductionConfig(Config):
|
|
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
'development': DevelopmentConfig,
|
2019-07-08 08:52:36 +00:00
|
|
|
'testing': TestingConfig,
|
2019-07-03 13:40:09 +00:00
|
|
|
# 'production': ProductionConfig,
|
|
|
|
|
|
|
|
'default': DevelopmentConfig
|
|
|
|
}
|