import os

basedir = os.path.abspath(os.path.dirname(__file__))


class Config:
    DEBUG = False
    TESTING = False
    API_DESCRIPTION = 'Broccoli Rule Engine'
    SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://postges:postges@10.1.1.5:5432/dqdb_test'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT')
    PORT = 5800
    AUTO_UPDATE = False
    CACHE_TYPE = "SimpleCache"
    CACHE_DEFAULT_TIMEOUT = 300


class DevelopmentConfig(Config):
    """
    Development configurations
    """
    DEBUG = False
    SQLALCHEMY_ECHO = True
    ASSETS_DEBUG = False


class ProductionConfig(Config):
    """
    Production configurations
    """
    DEBUG = False
    AUTO_UPDATE = True


class TestingConfig(Config):
    TESTING = True


class LocalConfig(Config):
    DEBUG = True
    AUTO_UPDATE = False


configs = {
    'development': DevelopmentConfig(),
    'testing': TestingConfig(),
    'production': ProductionConfig(),
    'default': LocalConfig(),
    'local': LocalConfig()
}
