Work in progress: read-only startup diagnostics for Django and Django REST framework services.
pip install drf-diag-utils-wip Copy PIP instructions
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.
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.
uv sync uv run pytest uv run ruff check . uv build License MIT - see LICENSE.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
None of the files in this release were uploaded with provenance metadata.
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.




