Skip to main content

Satellite Observability for Django - A modern debugging and observability tool

Project description

🛰️ Django Orbit

Satellite Observability for Django

A debugging and observability dashboard that orbits your app without touching it.

Django Orbit Dashboard

PyPI version Python Django License Code Style

📚 Documentation · 🎮 Try the Demo · ⭐ Star on GitHub


Table of Contents


🎯 Why Orbit?

Unlike Django Debug Toolbar — which injects HTML into your templates — Django Orbit lives at its own isolated URL (/orbit/). It observes your application from a distance, like a satellite, without interfering with it.

Django Debug Toolbar Django Orbit
Template injection ✅ Yes ❌ No
Works with APIs / SPAs ❌ No ✅ Yes
SQL + logs + exceptions Partial ✅ All in one
Background jobs ✅ Celery, RQ, Django-Q
AI assistant integration ✅ MCP Server
Health / module status

Inspired by Laravel Telescope.


📡 What Orbit tracks

Category Events
HTTP Requests, responses, headers, body, status codes
Database SQL queries, slow queries, N+1 detection
Logging All Python logging output, any level
Exceptions Full traceback, request context
Cache GET hits/misses, SET, DELETE (any backend)
Models ORM create, update, delete events
Commands manage.py executions with exit code
HTTP Client Outgoing requests via requests / httpx
Mail Sent emails with headers and body
Signals Django signal dispatches
Background Jobs Celery, Django-Q, RQ, APScheduler
Redis GET, SET, DEL, HGET, LPUSH, and more
Permissions Authorization checks, granted/denied
Transactions atomic() blocks, commits, rollbacks
Storage File save/open/delete (local + S3)

All events are linked by family_hash, so you can see every query, log, and exception that occurred within a single request.


📦 Installation

pip install django-orbit

# With MCP support (AI assistant integration — Claude, Cursor, Copilot)
pip install django-orbit[mcp]

🚀 Quick Start

1. Add to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'orbit',
]

2. Add middleware (early in the list):

MIDDLEWARE = [
    'orbit.middleware.OrbitMiddleware',
    # ...
]

3. Include URLs:

from django.urls import path, include

urlpatterns = [
    path('orbit/', include('orbit.urls')),
    # ...
]

4. Migrate and run:

python manage.py migrate orbit
python manage.py runserver

Visit http://localhost:8000/orbit/ 🚀


🎮 Try the Demo

git clone https://github.com/astro-stack/django-orbit.git
cd django-orbit
pip install -e .
python demo.py setup
python manage.py runserver
URL
http://localhost:8000/ Demo app
http://localhost:8000/orbit/ Orbit Dashboard
http://localhost:8000/orbit/stats/ Stats Dashboard
http://localhost:8000/orbit/health/ Health Dashboard

⚙️ Configuration

All settings go in ORBIT_CONFIG (or ORBIT) in your settings.py. Everything has a sensible default — you only need to set what you want to change.

ORBIT_CONFIG = {
    'ENABLED': True,                      # set to DEBUG to auto-disable in production
    'SLOW_QUERY_THRESHOLD_MS': 500,
    'STORAGE_LIMIT': 1000,                # max entries to keep

    # Watchers — all enabled by default
    'RECORD_REQUESTS': True,
    'RECORD_QUERIES': True,
    'RECORD_LOGS': True,
    'RECORD_EXCEPTIONS': True,
    'RECORD_COMMANDS': True,
    'RECORD_CACHE': True,
    'RECORD_MODELS': True,
    'RECORD_HTTP_CLIENT': True,
    'RECORD_MAIL': True,
    'RECORD_SIGNALS': True,
    'RECORD_JOBS': True,
    'RECORD_REDIS': True,
    'RECORD_GATES': True,
    'RECORD_TRANSACTIONS': True,
    'RECORD_STORAGE': True,

    # Security
    'AUTH_CHECK': lambda request: request.user.is_staff,
    'IGNORE_PATHS': ['/orbit/', '/static/', '/media/'],

    # Resilience
    'WATCHER_FAIL_SILENTLY': True,        # failed watchers log errors but don't crash the app
}

📊 Dashboards

Main Dashboard — /orbit/

HTMX-powered live feed with 3-second polling. Filter by event type, search by keyword, export to JSON, and click any entry to see its full detail in a slide-over panel.

Stats Dashboard — /orbit/stats/

Metric
Apdex Score User satisfaction index (0–1)
Percentiles P50, P75, P95, P99 response times
Error Rate Failure percentage with trend
Throughput Requests per minute / hour
Slow Queries Count and top offenders
Cache Hit Rate Sparkline chart
Job Success Rate Per-backend breakdown
Top Denied Permissions Authorization audit

Time range filters: 1h · 6h · 24h · 7d

Health Dashboard — /orbit/health/

Shows the status of every Orbit module:

  • 🟢 Healthy — working normally
  • 🔴 Failed — initialization error (click for full traceback)
  • 🟡 Disabled — turned off via config

🤖 MCP Server — AI Assistant Integration

Django Orbit exposes your telemetry as an MCP (Model Context Protocol) server. Connect Claude, Cursor, Windsurf, or any MCP-compatible AI assistant and ask questions directly against your app's live data.

Examples:

  • "Why is /api/orders/ slow?"
  • "What exceptions occurred in the last hour?"
  • "Find all N+1 patterns in the app"
  • "Show me everything that happened during this request"

Setup

pip install django-orbit[mcp]
// Claude Desktop → claude_desktop_config.json
// Cursor → .cursor/mcp.json
// Windsurf → .windsurfrc
{
  "mcpServers": {
    "django-orbit": {
      "command": "python",
      "args": ["manage.py", "orbit_mcp"],
      "cwd": "/path/to/your/django/project"
    }
  }
}

The MCP server launches on-demand when your AI assistant needs it. No extra process to manage.

Available tools

Tool What it returns
get_recent_requests Last N requests with status, path, duration
get_slow_queries SQL queries above threshold, sorted by duration
get_exceptions Exceptions in a time window with full traceback
get_n1_patterns Requests where N+1 duplicate queries were detected
get_request_detail Every event for one request via family_hash
search_entries Keyword search across all event types
get_stats_summary Error rate, avg response time, cache hit rate

🔧 Background Job Integrations

Backend How
Celery Via signals (automatic)
Django-Q Via signals (automatic)
RQ Worker monkey-patching (automatic)
APScheduler register_apscheduler(scheduler)
django-celery-beat Via model signals (automatic)

💚 Health & Plug-and-Play

Each watcher initializes independently. If Celery isn't installed, only the Celery watcher fails — everything else keeps working.

from orbit import get_watcher_status, get_failed_watchers

get_watcher_status()
# {'cache': {'installed': True, 'error': None, 'disabled': False}, ...}

get_failed_watchers()
# {'celery': 'ModuleNotFoundError: No module named celery'}

🛡️ Security

Restrict access using any callable:

ORBIT_CONFIG = {
    # Staff only
    'AUTH_CHECK': lambda request: request.user.is_staff,

    # Disable entirely in production
    'ENABLED': DEBUG,
}

Orbit automatically redacts sensitive fields (passwords, tokens, API keys) from request bodies and headers.


🗺️ Roadmap

What's next

  • External storage backends — persist events to PostgreSQL or Redis instead of SQLite
  • AI Insights engine — automatic pattern detection and plain-English summaries powered by LLMs
  • VS Code / Cursor extension — surface Orbit data in your editor sidebar while you code
  • Alerting — Slack, email, and webhook notifications for exceptions and slow requests
  • Orbit Cloud — shared team dashboards with historical data retention

🤝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

📄 License

MIT — see 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

django_orbit-0.7.0.tar.gz (99.4 kB view details)

Uploaded Source

Built Distribution

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

django_orbit-0.7.0-py3-none-any.whl (84.8 kB view details)

Uploaded Python 3

File details

Details for the file django_orbit-0.7.0.tar.gz.

File metadata

  • Download URL: django_orbit-0.7.0.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for django_orbit-0.7.0.tar.gz
Algorithm Hash digest
SHA256 a89d208899e2f541f47c8eac2c4dfbefa38c0d782b06da8349e65ed8973db2cb
MD5 eb28c0b210aaa72a1430721834216bac
BLAKE2b-256 66e510788ed17a57d8959f3aa160bac94f7330ed742506a858f11cbb74d9e6e3

See more details on using hashes here.

File details

Details for the file django_orbit-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: django_orbit-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 84.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for django_orbit-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4dc5d415b27d2202d027cbdc80f5ff0bb16f2ee8ab828ef2a787c614662c4ed
MD5 4e982dc5dfc1ee02b4bfbeebf76f887b
BLAKE2b-256 4a0607b1e0489dd819961df7642193f9b9aa40e99566b36c71ec35e61344429e

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