Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/settings/production.py
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if not conf.get(key): | ||||
"Production: invalid configuration; missing %s config entry." % (key,) | "Production: invalid configuration; missing %s config entry." % (key,) | ||||
) | ) | ||||
ALLOWED_HOSTS += conf.get("allowed_hosts", []) | ALLOWED_HOSTS += conf.get("allowed_hosts", []) | ||||
private_conf = conf["private"] | private_conf = conf["private"] | ||||
SECRET_KEY = private_conf["secret_key"] | SECRET_KEY = private_conf["secret_key"] | ||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#logging | # Deactivate logging configuration as our uwsgi application is configured to do it | ||||
LOGGING = { | # https://docs.djangoproject.com/en/2.2/ref/settings/#logging-config | ||||
"version": 1, | LOGGING_CONFIG = None | ||||
"disable_existing_loggers": False, | |||||
"formatters": { | |||||
"standard": { | |||||
"format": "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", # noqa | |||||
"datefmt": "%d/%b/%Y %H:%M:%S", | |||||
}, | |||||
}, | |||||
"handlers": { | |||||
"console": { | |||||
"level": "INFO", | |||||
"class": "logging.StreamHandler", | |||||
"formatter": "standard", | |||||
}, | |||||
}, | |||||
"loggers": { | |||||
"django": {"handlers": ["console"], "level": "INFO", "propagate": True,}, | |||||
}, | |||||
} | |||||
# database | # database | ||||
db_conf = private_conf.get("db", {"name": "unset"}) | db_conf = private_conf.get("db", {"name": "unset"}) | ||||
db = { | db = { | ||||
"ENGINE": "django.db.backends.postgresql", | "ENGINE": "django.db.backends.postgresql", | ||||
"NAME": db_conf["name"], | "NAME": db_conf["name"], | ||||
Show All 28 Lines |