drf-diag-utils-wip
Read-only startup diagnostics for Django and Django REST framework services.
Work in progress. This package is permanently pre-release: its API and output may change in any version. Pin an exact version if you depend on it.
collect() returns a list of entries describing the running service. print_diagnostics() writes them to the console. Nothing is written, no database connection is opened and no network call is made, so it is safe to run at startup in any environment.
Install
pip install "drf-diag-utils-wip[drf]" # the [drf] extra enables the endpoint and API sections
Use
Call it once Django is set up, for example from a management command or a provisioning step:
from drf_diag_utils import collect, print_diagnostics
print_diagnostics()
for entry in collect(): # or log the entries yourself
logger.info("%s: %s = %s", entry.section, entry.label, entry.value)
Output, for the small project in tests/:
[runtime]
Python 3.12.13
Django 6.1.2
Django REST framework 3.18.3
Settings module tests.settings
DEBUG False
[apps]
tests.demo Demo
third-party apps 3
[endpoints]
/api/ping/ GET (PingView)
/items/ GET POST (ItemViewSet)
/items/{pk}/ GET (ItemViewSet)
total 3
[api defaults]
authentication rest_framework.authentication.SessionAuthentication, rest_framework.authentication.BasicAuthentication
permissions rest_framework.permissions.IsAuthenticated
pagination rest_framework.pagination.PageNumberPagination
page size 25
[databases]
default django.db.backends.sqlite3
[checks]
errors 0
warnings 0
Sections
| Section | Shows |
|---|---|
| runtime | Python, Django and DRF versions, the settings module, DEBUG |
| apps | The project's own apps (under BASE_DIR, or outside the installed packages), then a count of third-party apps |
| endpoints | Every DRF endpoint with its methods and view, as DRF's schema generation enumerates them |
| api defaults | Default authentication, permission and pagination classes, and the page size |
| databases | The engine of each database alias - never its host, name or credentials |
| checks | The number of system-check errors and warnings, and each error |
A section that fails appears as an error entry instead of raising, so the diagnostics can never stop a service from starting.
Develop
uv sync
uv run pytest
uv run ruff check .
uv build
License
MIT - see LICENSE.
Metadata
Release files for drf-diag-utils-wip 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| drf_diag_utils_wip-0.1.0.tar.gz | 12.6 kB | Without provenance | Details for drf_diag_utils_wip-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| drf_diag_utils_wip-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for drf_diag_utils_wip-0.1.0-py3-none-any.whl |
Total release size: 19.2 kB
Release files / drf_diag_utils_wip-0.1.0.tar.gz
| Download URL | drf_diag_utils_wip-0.1.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e38cf61189984041680c29b7d2925596d75e8a4ec6daa7997e149fae496304fc
|
|
BLAKE2b-256 checksum How to use checksums |
e008ce5222e63a2bd7386e4c8983e0223f23a0cb8393b3fc7f664fc66d282173
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / drf_diag_utils_wip-0.1.0-py3-none-any.whl
| Download URL | drf_diag_utils_wip-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
413e08ded706c8f615e03d377f0b1b8d3f4f597f1d233a9c0c582e3344c04d15
|
|
BLAKE2b-256 checksum How to use checksums |
0baa9c73a2cb3a010e5403f21f309be69c5ee03981994ab80ece728fa5d2cff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for drf-diag-utils-wip 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.