django-permission-tracer: analyze and visualize permissions across your entire DRF project

Hi all,

I’ve released django-permission-tracer, a package for analyzing permissions across an entire Django REST Framework project, however many endpoints it has. I built it because reviewing permissions while debugging kept taking too long: an endpoint’s real permissions can come from permission_classes, an @action override, a get_permissions() method, or a composed expression, and it’s hard to see the result in one place.

It resolves permissions the way DRF does at request time, per HTTP method and viewset action, and shows them in a few ways:

  • A dashboard with an interactive graph. Pick a permission to see every endpoint and method it guards, or pick an endpoint to see each method’s permissions and the permission’s source code.
  • A permission matrix export (Markdown or CSV) for docs and security reviews.
  • A CI check that fails when an endpoint is unexpectedly reachable by anonymous users:
    python manage.py permission_tracer_analyze --fail-on-unprotected --allow '/api/health/'
  • Request tracing: which permission denied a request, and for composed permissions like IsOwner | IsAdminUser, which part failed.

Graph view demo

Install with pip install "django-permission-tracer[drf]". It supports Python 3.9+, Django 4.2 to 6.1 and DRF 3.14+. The dashboard only runs when DEBUG is on and is staff-only by default.

GitHub: GitHub - pradeeppc/django-permission-tracer: Trace and visualize Django permissions - see which permissions protect your APIs and where permissions are used · GitHub
PyPI: Client Challenge

It’s an early release, so feedback is very welcome, especially from projects with unusual setups: custom get_permissions(), token or JWT auth middleware, or heavy use of object-level permissions. What would make this useful in your workflow?

1 Like