import sentry_sdk from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.integrations.django import DjangoIntegration from .base import * # noqa: F401,F403 from .base import env DEBUG = False SECURE_SSL_REDIRECT = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True SECURE_HSTS_SECONDS = 31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_PRELOAD = True SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_REFERRER_POLICY = "same-origin" _sentry_dsn = env("SENTRY_DSN", default="") if _sentry_dsn: sentry_sdk.init( dsn=_sentry_dsn, integrations=[DjangoIntegration(), CeleryIntegration()], traces_sample_rate=0.1, send_default_pii=False, environment=env("SENTRY_ENV", default="production"), )