nopaque/config.py

47 lines
1.2 KiB
Python
Raw Normal View History

2019-07-03 08:31:23 +00:00
import os
basedir = os.path.abspath(os.path.dirname(__file__))
2019-07-03 08:31:23 +00:00
class Config:
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')
OPAQUE_ADMIN = os.environ.get('OPAQUE_ADMIN')
2019-07-08 09:29:11 +00:00
OPAQUE_MAIL_SUBJECT_PREFIX = '[Opaque]'
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'
SQLALCHEMY_TRACK_MODIFICATIONS = False
2019-07-03 13:40:09 +00:00
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
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
}