Sniff your django models to look for any data issues
Project description
django-data-sniffer
django-data-sniffer provides a set of tools to inspect the data in your service for misconfigurations
Features
- Configurable warning/alert queries on any database table in your django app
- A view to see all misconfigured objects in your table
- Ability to modify your queries via an externally hosted manifest file so that adding a new health check doesn't require a deployment
Setup
Installation
pip install django_data_sniffer
Add to settings.py
INSTALLED_APPS = (
...
'data_sniffer
...
)
DATA_SNIFFER_ENABLED = True
DATA_SNIFFER_MANIFEST_FILE = 'https://path/to/your/manifest/file.json' # noqa
Configuring the manifest file
Here's an example manifest file
{
"clients": {
"name": "Active clients healthcheck",
"model": "yourapp.Client",
"queryset": {
"filters": {
"status": "active"
},
"excludes": null,
"ordering": null,
"display_field": "name",
"extra_display_fields": ["id", "membership_type"]
},
"alerts": [
{
"level": "WARNING",
"name": "Missing billing",
"queryset": {
"filters": {
"billing_configured": false
}
},
"message": "Client does not have billing set up"
},
{
"level": "ERROR",
"name": "Missing billing and getting premium features",
"queryset": {
"filters": {
"billing_configured": false,
"premium_features_enabled": true
},
"excludes": {
"is_demo": true
}
},
"message": "Client has invalid feature set"
}
]
}
}
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 django-data-sniffer-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454ce6fd0a6f0865d84e3c84bf608a6ddcbdf4383a2559584edbc25aac25f8af |
|
MD5 | 3e317c67f8089b813f5e63f41c8b1d6a |
|
BLAKE2b-256 | 1bdaa66055201c322b2d02ea1c71550a29b17914e11bd03b327c71d01e8e3aa3 |
Close
Hashes for django_data_sniffer-0.2.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078b81837082514fbb91570e0b5ed7149f906628e1657a49a4b1489c00b780e1 |
|
MD5 | 768761fce0774b79030866e02e1badc9 |
|
BLAKE2b-256 | af9ea3378bbdbe8882ad03014e4d0d176d9ac80764c2c3deb3068ca44a84975f |