Skip to content

Instantly share code, notes, and snippets.

@ashwoods
Last active January 17, 2018 11:22
Show Gist options
  • Save ashwoods/04102e1ee5cf191b127297314c1e9ced to your computer and use it in GitHub Desktop.
Save ashwoods/04102e1ee5cf191b127297314c1e9ced to your computer and use it in GitHub Desktop.
settings examples
# Extracting all settings into its own class
# and making all registered defaults "settable" with env vars
# easier to subclass and or register with plugins
config = {
'LOGGER_EXCEPTIONS' = ['path.to.module','path.to.module2'],
'ENABLE_SOMETHING' = True
}
# Deprecate all args/kwargs and allow passing dict-like object
# Would force users to change eventually (after long deprecation period)
sentry = Client(dsn=****, config)
# in order to keep consistency with env vars
# i considered following sentry.settings.MY_VAR
# and picked up by default from envirn with `SENTRY_MY_VAR`
config = {
'LOGGER_EXCEPTIONS' = ['path.to.module','path.to.module2'],
'ENABLE_SOMETHING' = True
}
# Allow passing (maybe case insenstive) kwargs, would keep backwards compat indefinitely
sentry = Client(dsn=****, enabled_something_else=enable_something_else, **config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment