This repository has been archived on 2020-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
magic-app/magic_app/config.py

49 lines
1016 B
Python

"""The Application settings."""
from os import environ, pardir
from os.path import abspath, dirname, join
class Base:
"""The base configuration."""
DEBUG = False
JSON_AS_ASCII = False
APP_DIR = abspath(dirname(__file__))
PROJECT_ROOT = abspath(join(APP_DIR, pardir))
SWAGGER_DIR = abspath(join(PROJECT_ROOT, "swagger_docs"))
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"
DEBUG = True
CELERY_ALWAYS_EAGER = True
class Testing(Base):
"""The testing configuration."""
ENV = "testing"
class Production(Base):
"""The production configuration."""
ENV = "production"
CONFIG = {
"development": Development,
"testing": Testing,
"production": Production,
}