mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
48 lines
1.3 KiB
Python
48 lines
1.3 KiB
Python
import os
|
|
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
class Config:
|
|
MAIL_SERVER = os.environ.get('MAIL_SERVER', 'smtp.gmail.com')
|
|
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_ADMIN = os.environ.get('OPAQUE_ADMIN')
|
|
OPAQUE_STORAGE = os.environ.get('OPAQUE_STORAGE')
|
|
OPAQUE_MAIL_SUBJECT_PREFIX = '[Opaque]'
|
|
OPAQUE_MAIL_SENDER = 'Opaque Development <dev.opaque@gmail.com>'
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
|
|
@staticmethod
|
|
def init_app(app):
|
|
pass
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
DEBUG = True
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data_dev.sqlite')
|
|
|
|
|
|
class TestingConfig(Config):
|
|
TESTING = True
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
|
|
'sqlite://'
|
|
WTF_CSRF_ENABLED = False
|
|
|
|
|
|
# class ProductionConfig(Config):
|
|
|
|
|
|
config = {
|
|
'development': DevelopmentConfig,
|
|
'testing': TestingConfig,
|
|
# 'production': ProductionConfig,
|
|
|
|
'default': DevelopmentConfig
|
|
}
|