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.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d8790c4132d816b7c40ef1b5215df19834244d4bd1b3cf555e6507c54843220 |
|
MD5 | b2ba08157aa22de03c691a0b14062c28 |
|
BLAKE2b-256 | 0fdb64637c208ed20717cf17aa2671762fe87314fc5590c40abfd3da5d497b97 |
Close
Hashes for django_data_sniffer-0.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0ca9c51651767ffa8ace6aa6ffafe5b907032f78e40407d47efd4cbc72e53d1 |
|
MD5 | dd80b261c5595434e915d285b230cf03 |
|
BLAKE2b-256 | b3873a4ee0fede880c9c060d4e2fc641df325253175e24f672825ac8e381d521 |