44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
|
import os
|
||
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
||
|
|
||
|
|
||
|
class Config:
|
||
|
SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
|
||
|
SECURITY_REGISTERABLE = True
|
||
|
SECURITY_CHANGEABLE = True
|
||
|
SECURITY_RECOVERABLE = True
|
||
|
SECURITY_PASSWORD_SALT = os.environ.get('SECURITY_PASSWORD_SALT') or 'SOME SECRET STRING'
|
||
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'SOME SECRET STRING'
|
||
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||
|
MAIL_SERVER = 'smtp.googlemail.com'
|
||
|
MAIL_PORT = 587
|
||
|
MAIL_USE_TLS = True
|
||
|
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
||
|
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
||
|
|
||
|
@staticmethod
|
||
|
def init_app(app):
|
||
|
pass
|
||
|
|
||
|
|
||
|
class DevelopmentConfig(Config):
|
||
|
SECURITY_SEND_REGISTER_EMAIL = False
|
||
|
DEBUG = True
|
||
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data_dev.sqlite')
|
||
|
|
||
|
|
||
|
class TestingConfig(Config):
|
||
|
TESTING = True
|
||
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data_testing.sqlite')
|
||
|
|
||
|
|
||
|
class ProductionConfig(Config):
|
||
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
|
||
|
|
||
|
|
||
|
config = {
|
||
|
'development': DevelopmentConfig,
|
||
|
'testing': TestingConfig,
|
||
|
'production': ProductionConfig,
|
||
|
'default': DevelopmentConfig
|
||
|
}
|