Django Performance Monitoring
Errors, logs, and traces for your Django applications. Scout's Python agent automatically instruments Django views, detects N+1 queries in the Django ORM, monitors Celery background tasks, and catches memory bloat. Requires Python 3.8+ on Linux or macOS.
Errors, Logs, and Traces in One View for Django Apps
Scout connects Django exceptions to the full request trace and surrounding log lines in a single view. When a view raises an exception or a Celery task fails, you see the error, the trace with per-operation timing, and the log context together. No switching between Sentry, your log tool, and your APM.
Error Monitoring
Automatic exception capture across Django views, middleware, and Celery tasks. Errors are linked to the originating trace with request context, so you see which views and endpoints are affected.
Log Management
Log output is enriched with trace context and forwarded alongside performance data. Filter logs by trace ID to see exactly what your Django application was doing before, during, and after an issue.
App Traces
Transaction tracing with code-level visibility into Django views, ORM queries, template rendering, and external HTTP calls. Detailed backtraces show the exact line of code responsible for slow responses.
N+1 Detection in the Django ORM
Scout automatically detects N+1 query patterns in the Django ORM without configuration. The agent monitors database queries within Django views and Celery tasks, identifies repeated query patterns caused by lazy loading in related objects, and shows the exact code location and performance impact. Supports SQLite, PostgreSQL, MySQL, MariaDB, Oracle, MS SQL, and CockroachDB.
What Scout Instruments in Your Django App
Scout auto-instruments Django at the framework level. Views, middleware, template rendering, and ORM queries are all captured automatically. Celery and Dramatiq background tasks appear with per-task timing and error tracking. ElasticSearch, Jinja2, PyMongo, Redis, and UrlLib3/Requests are instrumented with zero configuration. No manual spans or decorators required.
Works with the Django frameworks you already use
Scout auto-instruments the frameworks and libraries in your stack. No manual configuration required.
Web Framework
- Django
- Django REST Framework
Task Queues
- Celery
- Dramatiq
- Huey
- RQ
Databases
- Django ORM
- SQLAlchemy
- PyMongo
- Redis
- ElasticSearch
Other
- Jinja2
- Requests
Memory Bloat Detection for Django and Celery
Django applications and Celery workers can accumulate memory over time, especially in long-running processes. Scout detects memory bloat at the transaction level, showing which views, endpoints, and Celery tasks are responsible for memory growth. This goes beyond host-level metrics by telling you what is causing the increase, not just that it is happening.
Query Your Django App Data from AI Assistants and the Terminal
Scout offers hosted and local MCP servers with 17 tools, a Go CLI available via Homebrew with TOON format for LLM output, and a public API. Query your Django application's errors, traces, ORM N+1 insights, and Celery job performance from Claude Code, Cursor, or the terminal.
MCP Server
Hosted or local MCP server with 17 tools covering apps, endpoints, traces, errors, insights, background jobs, and usage data. Works with Claude Code, Cursor, VS Code Copilot, and any MCP-enabled assistant.
Scout CLI
Go binary available via Homebrew. Query app metrics, endpoint performance, traces, error groups, and insights from the terminal. Outputs human-friendly tables or TOON format for LLM consumption.
Public API
Full programmatic access to your monitoring data for building custom integrations, dashboards, or automation workflows.
Add Scout to Your Django App
Get Scout running on your Django app in under 3 minutes.
Install the package:
pip install scout-apmAdd to INSTALLED_APPS in your Django settings and configure your Scout key.
Deploy and see data in 5 minutes.
Django Monitoring FAQ
What is the best monitoring tool for Django?
Scout Monitoring provides integrated errors, logs, and traces for Django applications. The Python agent includes automatic N+1 detection in the Django ORM, memory bloat detection at the transaction level, Celery and Dramatiq background task monitoring, and auto-instrumentation for ElasticSearch, PyMongo, Redis, and Jinja2. Scout is built for Django teams that want all their monitoring signals in one place without enterprise complexity.
What is the best APM for Django?
Scout is a Python APM designed for Django teams that value fast setup and actionable data. The agent requires Python 3.8+ and runs on Linux and macOS. It covers Django views, middleware, ORM queries, template rendering, Celery, and Dramatiq out of the box, with automatic instrumentation for ElasticSearch, PyMongo, Redis, and Requests. You get errors, logs, traces, N+1 detection, and memory profiling in a single tool.
How do I detect N+1 queries in Django?
Scout automatically detects N+1 query patterns in the Django ORM without any configuration. The agent monitors database queries within Django views and Celery tasks, identifies repeated query patterns caused by accessing related objects in a loop, and shows the exact code location, the number of excess queries, and the total performance impact. No select_related or prefetch_related audit required to find the problems.
How do I monitor Celery tasks in a Django app?
Scout auto-instruments Celery tasks in Python. Add the scout_apm package to your Django project and each Celery task appears as its own transaction in Scout with execution timing, error tracking, and N+1 detection. Memory bloat analysis applies to Celery workers the same way it applies to Django views. Dramatiq, Huey, and RQ are also supported.
How do I find memory leaks in Django?
Scout detects memory bloat at the transaction level in your Django application. The agent identifies which specific views, API endpoints, and Celery tasks are responsible for memory growth, so you can fix the root cause rather than just restarting your application server. This works across Django views, Celery workers, and Dramatiq actors.
Does Scout support error monitoring for Django?
Yes. Scout captures exceptions across Django views, middleware, and Celery tasks automatically. Each error is linked to the request trace and surrounding log context, so you see the error, the full trace, and the log lines together in one view without switching between separate error tracking and APM tools.
Does Scout support Django REST Framework?
Yes. Scout instruments Django at the view level, which covers Django REST Framework API views and viewsets. Each API endpoint appears as a transaction in Scout with timing for serialization, ORM queries, and any external service calls. N+1 detection applies to DRF views the same way it applies to standard Django views.
How do I add Scout to a Django project?
Install the package with pip install scout-apm, add scout_apm.django to INSTALLED_APPS in your settings.py, add your Scout key and app name to settings, and deploy. The agent begins instrumenting views, ORM queries, and Celery tasks immediately with no additional configuration.
Can I use Scout with Claude Code or Cursor for Django debugging?
Yes. Scout offers hosted and local MCP servers with 17 tools that work with Claude Code, Cursor, VS Code Copilot, and any MCP-enabled assistant. You can query your Django application's errors, slow view traces, ORM N+1 insights, and Celery task performance in natural language from your editor. The Scout CLI, available via Homebrew, gives terminal access to the same data in TOON format for LLM consumption.