feat(api): split api into multiple apps (#1626)
Fixes #1622 - split the api into 4 apps: core, history, schedule, storage - exploded the settings into testing/prod
This commit is contained in:
parent
87d2da9d84
commit
fce988aef1
120 changed files with 1499 additions and 1078 deletions
55
api/libretime_api/settings/prod.py
Normal file
55
api/libretime_api/settings/prod.py
Normal file
|
@ -0,0 +1,55 @@
|
|||
from os import getenv
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from ._internal import (
|
||||
API_VERSION,
|
||||
AUTH_PASSWORD_VALIDATORS,
|
||||
AUTH_USER_MODEL,
|
||||
DEBUG,
|
||||
DEFAULT_AUTO_FIELD,
|
||||
INSTALLED_APPS,
|
||||
MIDDLEWARE,
|
||||
REST_FRAMEWORK,
|
||||
ROOT_URLCONF,
|
||||
SPECTACULAR_SETTINGS,
|
||||
STATIC_URL,
|
||||
TEMPLATES,
|
||||
WSGI_APPLICATION,
|
||||
setup_logger,
|
||||
)
|
||||
from ._schema import Config
|
||||
|
||||
LIBRETIME_LOG_FILEPATH = getenv("LIBRETIME_LOG_FILEPATH")
|
||||
LIBRETIME_CONFIG_FILEPATH = getenv("LIBRETIME_CONFIG_FILEPATH")
|
||||
|
||||
CONFIG = Config(filepath=LIBRETIME_CONFIG_FILEPATH)
|
||||
|
||||
SECRET_KEY = CONFIG.general.api_key
|
||||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
LOGGING = setup_logger(LIBRETIME_LOG_FILEPATH)
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql",
|
||||
"HOST": CONFIG.database.host,
|
||||
"PORT": CONFIG.database.port,
|
||||
"NAME": CONFIG.database.name,
|
||||
"USER": CONFIG.database.user,
|
||||
"PASSWORD": CONFIG.database.password,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/3.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = "en-us"
|
||||
TIME_ZONE = "UTC"
|
||||
USE_I18N = True
|
||||
USE_L10N = True
|
||||
USE_TZ = True
|
Loading…
Add table
Add a link
Reference in a new issue