|
|
|
@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/4.0/ref/settings/
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
from os import getenv
|
|
|
|
|
import sentry_sdk
|
|
|
|
|
from sentry_sdk.integrations.celery import CeleryIntegration
|
|
|
|
|
from sentry_sdk.integrations.django import DjangoIntegration
|
|
|
|
|
|
|
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
@ -25,8 +28,10 @@ SECRET_KEY = getenv(
|
|
|
|
|
"SECRET_KEY", "django-insecure-pdgzgd_!w&&cfqc%r&!v_^6pgf!sza=2wim67()!(kaf7_6-5)"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ENVIRONMENT = getenv("ENVIRONMENT", "development")
|
|
|
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
|
DEBUG = getenv("ENVIRONMENT", "development") != "production"
|
|
|
|
|
DEBUG = ENVIRONMENT == "development"
|
|
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = list(filter(lambda s: s != "", getenv("ALLOWED_HOSTS", "").split(",")))
|
|
|
|
|
|
|
|
|
@ -151,3 +156,12 @@ CELERY_BEAT_SCHEDULE = {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CELERY_BEAT_SCHEDULE_FILENAME = str(BASE_DIR / "storage" / "celerybeat-schedule")
|
|
|
|
|
|
|
|
|
|
if getenv("SENTRY_DSN"):
|
|
|
|
|
sentry_sdk.init(
|
|
|
|
|
dsn=getenv("SENTRY_DSN"),
|
|
|
|
|
integrations=[CeleryIntegration(), DjangoIntegration()],
|
|
|
|
|
auto_session_tracking=False,
|
|
|
|
|
traces_sample_rate=0,
|
|
|
|
|
environment=ENVIRONMENT,
|
|
|
|
|
)
|
|
|
|
|