Easy Django-Sentry integration via Django settings.
Project description
Sentry Django Settings
This is a package for Django that allows you to add Sentry integration by adding a Django setting.
Installation
pip install sentry_django_settings
Add sentry_django_settings.apps.Sentry
to your INSTALLED_APPS
.
INSTALLED_APPS = [
# ...
'sentry_django_settings.apps.Sentry',
# ...
]
Add a setting like the following to your settings.py
file:
SENTRY = {
'enabled': True,
'dsn': "https://2e2ac79f64d34e4b85c3a3173e343464@sentry.mysite.com/5",
'environment': "dev", # Optional
'release': '1.0', # Optional
'git_sha_path': './git_sha' # Optional
}
enabled
is a boolean if Sentry should be initialized or not.
To find the DSN in Sentry:
- Go to the project settings in Sentry
- Under
Data
, selectError Tracking
- Click "Get your DSN."
- Use the "Public DSN" in all cases.
The environment
should be appropriate to environment where the server will be running.
The release
can be any string. If left blank or excluded and this is being run inside of a Git repo, the Git SHA will be used instead. Note: If release
is defined, then git_sha_path
is ignored.
The git_sha_path
is a path to a file that contains the Git SHA string. This is useful when deploying via a packaging service. During packaging, create a file that has the Git SHA, then reference it in this setting. Note: If release
is defined, then git_sha_path
is ignored.
All other keys passed into the settings are forwarded onto the Sentry SDK init
method. See their documentation for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sentry_django_settings-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887393dd84fccacd16e47906510409748f2ace490a32ef61be6ab4bde0cc8b51 |
|
MD5 | 2fa8bfc99f0a0203e9e730a8d7acd622 |
|
BLAKE2b-256 | 107a4e4af8049668883453e58f6c3ae5cfd8195c9cc84e5ab66875abdbdcc15b |
Hashes for sentry_django_settings-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb781e08689001b957bcc86fb058976f3a0b03d36db4db9c118e55fdf6f71db |
|
MD5 | 77396cfe10f4190fec6c79897f91ce39 |
|
BLAKE2b-256 | c7fb744db9d697f23f92e8c3ff871410eebb10f0a3f8d50ad8e753feaf084ded |