Skip to main content

A comprehensive Django app that provides visualization and analysis of your DRF backend.

Project description

DRF Inspector

DRF Inspector is a powerful developer tool for analyzing, visualizing, and understanding Django REST Framework (DRF) backends.

It automatically inspects your project architecture and provides interactive visualizations for:

  • API endpoints
  • serializers
  • models
  • relationships
  • views
  • query optimization
  • security analysis
  • architecture exporting

DRF Inspector helps developers debug, document, optimize, and better understand complex DRF projects.


Features

API & URL Analysis

  • Inspect all DRF endpoints automatically
  • Detect HTTP methods (GET, POST, PATCH, etc.)
  • View connected views and serializers
  • Search and filter endpoints

Model Visualization

  • Auto-generate model relationship graphs
  • Visualize:
    • ForeignKey
    • ManyToManyField
    • OneToOneField
  • Interactive relationship mapping

Serializer Inspection

  • Detect serializers used in views
  • Inspect serializer fields
  • Detect nested serializers
  • Show serializer → model mappings

View Analysis

  • Analyze:
    • authentication classes
    • permission classes
    • pagination
    • throttling
    • filtering
  • Supports DRF class-based views and ViewSets

Security Audit

  • Detect endpoints missing:
    • authentication
    • permissions
    • throttling
  • Helps identify insecure API routes

Query Optimization Detection

  • Detect possible N+1 query issues
  • Suggest:
    • select_related
    • prefetch_related
  • Analyze queryset optimization opportunities

Exporting

Export project architecture as:

  • JSON
  • Markdown

Useful for:

  • documentation
  • architecture reviews
  • team sharing
  • AI context sharing

Interactive Frontend

Built-in dashboard directly served from Django:

  • No React setup required
  • No separate frontend server
  • Works directly inside your Django project

Screenshots

Dashboard

Dashboard

URL Explorer

URLs

Model Relationships

Models

Serializer Inspector

Serializers

Query Optimization

Optimization


Installation

Install the package:

pip install drf-inspector

Quick Start

1. Add to Installed Apps

INSTALLED_APPS = [
    ...
    "drf_inspector",
]

2. Include URLs

from django.urls import path, include

urlpatterns = [
    ...
    path(
        "drf-inspector/",
        include("drf_inspector.urls")
    ),
]

3. Run Server

python manage.py runserver

4. Open Dashboard

Visit:

http://127.0.0.1:8000/drf-inspector/

Supported Features

Feature Supported
APIView
GenericAPIView
ViewSets
ModelViewSet
ReadOnlyModelViewSet
Nested Serializers
Model Relationship Graphs
JSON Export
Markdown Export

Current Limitations

Function-Based Views (FBV)

DRF Inspector currently focuses primarily on DRF class-based views.

Basic FBV detection may work, but:

  • serializer analysis
  • queryset analysis
  • optimization analysis

may not be fully supported for function-based views.


Dynamic Serializers

Views using highly dynamic serializer selection may not always be fully analyzable.

Example:

def get_serializer_class(self):
    ...

Runtime Query Tracking

Current query optimization analysis is static.

Runtime SQL monitoring and live query profiling are planned for future releases.


Roadmap

Planned future features:

  • Runtime request monitoring
  • SQL query timeline
  • WebSocket inspector
  • OpenAPI visualization
  • Middleware analysis
  • Live API analytics
  • Permission dependency graph
  • API testing utilities
  • Performance profiling
  • Docker deployment support

Why DRF Inspector?

Modern DRF projects become difficult to understand as they grow.

DRF Inspector helps developers:

  • understand backend architecture faster
  • onboard team members easier
  • debug APIs visually
  • optimize database queries
  • document projects automatically

Contributing

Contributions, issues, and feature requests are welcome.

Feel free to open issues or submit pull requests.


License

MIT License

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

drf_inspector-0.1.1.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drf_inspector-0.1.1-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file drf_inspector-0.1.1.tar.gz.

File metadata

  • Download URL: drf_inspector-0.1.1.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for drf_inspector-0.1.1.tar.gz
Algorithm Hash digest
SHA256 daf76af4e102c390e1c0cb783f894942dd4f4d652ff64684b23e7273d794f826
MD5 a16af64118aea3f6b807af7e8888b401
BLAKE2b-256 a9625eb0313a2998f83e4431188931de8ab86cce7738514867f374d319c92ae0

See more details on using hashes here.

File details

Details for the file drf_inspector-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: drf_inspector-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for drf_inspector-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0615eaaca7a6f36992faccd40d23c7cb356e31c82e44802ac9597866d0c4bd6b
MD5 24338489ea0f82e01172e293e08a0377
BLAKE2b-256 f608972d86484fd88db018baa1a27eb882edcac215ef01c0c963962d7b92dfdb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page