mirror of
https://github.com/fergalmoran/bitchmin.git
synced 2025-12-22 09:27:53 +00:00
57 lines
1.5 KiB
Python
57 lines
1.5 KiB
Python
import os
|
|
from datetime import timedelta
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
load_dotenv(os.path.join(basedir, '../.env'))
|
|
|
|
ISDEV = os.getenv('FLASK_ENV') == 'development'
|
|
|
|
|
|
class Config(object):
|
|
ISDEV = ISDEV
|
|
SECRET_KEY = os.getenv('SECRET_KEY') or 'you-will-never-guess'
|
|
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
|
'postgresql+psycopg2://bitchmin:bitchmin@localhost/bitchmin'
|
|
# 'sqlite:///' + os.path.join(basedir, '../app.db')
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
LOG_TO_STDOUT = os.getenv('LOG_TO_STDOUT')
|
|
ADMINS = ['Ferg@lMoran.me']
|
|
LANGUAGES = ['en', 'ie']
|
|
|
|
CELERY_BROKER_URL = os.getenv('CELERY_BROKER_URL')
|
|
CELERY_RESULT_BACKEND = os.getenv('CELERY_RESULT_BACKEND')
|
|
|
|
MAIL_SERVER = os.getenv('MAIL_SERVER')
|
|
MAIL_PORT = os.getenv('MAIL_PORT')
|
|
MAIL_USE_TLS = os.getenv('MAIL_USE_TLS')
|
|
MAIL_USE_SSL = os.getenv('MAIL_USE_SSL')
|
|
MAIL_USERNAME = os.getenv('MAIL_USERNAME')
|
|
MAIL_PASSWORD = os.getenv('MAIL_PASSWORD')
|
|
|
|
CELERYBEAT_SCHEDULE = {
|
|
'add-every-5-minutes': {
|
|
'task': 'app.tasks.hosts.check_host_records',
|
|
'schedule': timedelta(minutes=15)
|
|
}
|
|
}
|
|
|
|
|
|
class ProductionConfig(Config):
|
|
DEBUG = False
|
|
|
|
|
|
class StagingConfig(Config):
|
|
DEVELOPMENT = True
|
|
DEBUG = True
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
DEVELOPMENT = True
|
|
DEBUG = True
|
|
|
|
|
|
class TestingConfig(Config):
|
|
TESTING = True
|