Library to help with defining and running health checks for Maykin Django projects.
Project description
1 Welcome to Maykin Configuration Checks’ documentation!
- Version:
0.1.0
- Source:
- Keywords:
Django, Maykin, health checks
- PythonVersion:
3.12, 3.13
This library aims to standardise how health checks for Maykin Django applications are run. The checks are meant to validate that the configuration that is normally performed in the Admin or via django-setup-configuration is correct.
2 Installation
2.1 Requirements
Python 3.12 or above
Django 4.2 or newer
2.2 Install
pip install maykin-config-checks
Add maykin_config_checks to the Django INSTALLED_APPS:
INSTALLED_APPS = [
...
"maykin_config_checks",
...
]
3 Usage
3.1 View
To have an API view that returns the results of the performed health checks, add the following to the urlpatterns:
from django.urls import path
from maykin_config_checks.api.views import HealthChecksView
urlpatterns = [
...
path(
"health-checks",
HealthChecksView.as_view(
checks_collector=my_checks_collector_fn
),
name="health-checks",
),
]
Where my_checks_collector_fn is a Callable[[], Iterable[HealthCheck]]. It is used to retrieve which health checks should be performed by the view. You can also add the view multiple times to the urlpatters with different checks_collector arguments if you want to have multiple health check views that run different checks.
3.2 Management command
There is also a management command that can be used to run health checks from the CLI.
django-admin config_checks --checks-collector dotted.path.to.my_checks_collector_fn
4 Local development
To develop the library locally, use:
uv pip install -r pyproject.toml --all-extras
To run the test app, in the root of the repository run:
export DJANGO_SETTINGS_MODULE=testapp.settings
export PYTHONPATH=$PYTHONPATH:`pwd`
Then, you can run:
django-admin runserver
5 Running tests
To run the tests without tox, you can do the following (from the root of the repository):
export DJANGO_SETTINGS_MODULE=testapp.settings
export PYTHONPATH=$PYTHONPATH:`pwd`
pytest tests
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maykin_config_checks-0.1.0.tar.gz.
File metadata
- Download URL: maykin_config_checks-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd15e8e18a43c42b232bdef49f10a7ca3669b292e03dcf031cc689fd3bd6058b
|
|
| MD5 |
60680af16ebc8d1b5e049183c6b099a2
|
|
| BLAKE2b-256 |
8c842687952cb9e2bea9fe193236e41ac10d997ce85d25e99844436968852632
|
Provenance
The following attestation bundles were made for maykin_config_checks-0.1.0.tar.gz:
Publisher:
ci.yml on maykinmedia/config-checks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maykin_config_checks-0.1.0.tar.gz -
Subject digest:
cd15e8e18a43c42b232bdef49f10a7ca3669b292e03dcf031cc689fd3bd6058b - Sigstore transparency entry: 781153283
- Sigstore integration time:
-
Permalink:
maykinmedia/config-checks@4e653b55ec2377316cf27263b081a3dd49cb6765 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/maykinmedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4e653b55ec2377316cf27263b081a3dd49cb6765 -
Trigger Event:
push
-
Statement type:
File details
Details for the file maykin_config_checks-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maykin_config_checks-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d64d86a6bd0d3d1d3a5965376f712402694dfccaf0a95b15ddb011b4d83d7a6b
|
|
| MD5 |
14737fed2532c8c5fa864a1dd6691bce
|
|
| BLAKE2b-256 |
51c5956b2f6d302aeeb595cf45d27f2f0711535690a695862636429a7172894a
|
Provenance
The following attestation bundles were made for maykin_config_checks-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on maykinmedia/config-checks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maykin_config_checks-0.1.0-py3-none-any.whl -
Subject digest:
d64d86a6bd0d3d1d3a5965376f712402694dfccaf0a95b15ddb011b4d83d7a6b - Sigstore transparency entry: 781153285
- Sigstore integration time:
-
Permalink:
maykinmedia/config-checks@4e653b55ec2377316cf27263b081a3dd49cb6765 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/maykinmedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4e653b55ec2377316cf27263b081a3dd49cb6765 -
Trigger Event:
push
-
Statement type: