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-07-08 09:29:11 +00:00
|
|
|
MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.uni-bielefeld.de')
|
|
|
|
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')
|
|
|
|
OPAQUE_MAIL_SUBJECT_PREFIX = '[Opaque]'
|
|
|
|
OPAQUE_MAIL_SENDER = 'Opaque Admin <inf_sfb1288@uni-bielefeld.de>'
|
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
|
|
|
|
}
|