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`.
```python
INSTALLED_APPS = [
# ...
'sentry_django_settings.apps.Sentry',
# ...
]
```
Add a setting like the following to your `settings.py` file:
```python
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`, select `Error 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.
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`.
```python
INSTALLED_APPS = [
# ...
'sentry_django_settings.apps.Sentry',
# ...
]
```
Add a setting like the following to your `settings.py` file:
```python
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`, select `Error 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.
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
Close
Hashes for sentry_django_settings-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02823d93cdc15da3e0fd0c783515c77a12e810c96554858ba2ad49a6b0e056ad |
|
MD5 | 0381995d76da6171ced82fd68ff91ee0 |
|
BLAKE2b-256 | 8dc4a8e83933f62db9b60cbd653e58766bc04763b7e984a7c44205eaf583e33e |
Close
Hashes for sentry_django_settings-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 119d1719aabec36566ec538e94742fb4a116b9e681a630f3260a9fcd9ff7a220 |
|
MD5 | 22206e1cb67771bf910aa11e2d56fdfe |
|
BLAKE2b-256 | 197ec635921e6b766b6cd781a29c2bc86f361a65557723e72d779a0243537b38 |