sentry_sdk fails if django.conf.settings.ENVIRONMENT is missing
The initialization of sentry_sdk
looks like this:
sentry_sdk.init(
dsn=settings.SENTRY_DSN,
integrations=[DjangoIntegration()],
send_default_pii=True,
environment=settings.ENVIRONMENT,
release=f"grouprise@{__release__}",
)
But settings.ENVIRONMENT
is not guaranteed to be defined.
The value is probably supposed to be something like "production" or "development".
What should we do? Simply remove the environment
setting?