"""The Application settings."""
from os import environ, pardir
from os.path import abspath, dirname, join
from pathlib import Path
class Base:
"""The base configuration."""
DEBUG = False
JSON_AS_ASCII = False
SECRET_KEY = environ["SECRET_KEY"]
APP_DIR = abspath(dirname(__file__))
PROJECT_ROOT = abspath(join(APP_DIR, pardir))
REDIS_HOST = environ["REDIS_HOST"]
REDIS_PORT = environ["REDIS_PORT"]
REDIS_SESSION_DB = int(environ["REDIS_SESSION_DB"])
CELERY_BROKER_URL = environ["CELERY_BROKER_URL"]
CELERY_RESULT_BACKEND = environ["CELERY_RESULT_BACKEND"]
class Development(Base):
"""The Development configuration."""
ENV = "development"
CELERY_ALWAYS_EAGER = True
DEBUG = True
DATA_DIR = Path(Base.PROJECT_ROOT) / "data"
class Testing(Base):
"""The testing configuration."""
ENV = "testing"
TESTING = True
class Production(Base):
"""The production configuration."""
ENV = "production"
DATA_DIR = "/data"
CONFIG = {
"development": Development,
"testing": Testing,
"production": Production,
}