A configurable set of Django panels that show debug information about each request and response in the browser.
jazzband/django-silk
A live profiler and inspection UI for Django that records requests, SQL queries and code blocks to help find slow spots.
- Stars
- 5,005
- Forks
- 381
- Open issues
- 132
- Last commit
- 4 days ago
What is it?
Silk is a profiling tool for Django applications. Its middleware intercepts each HTTP request and response, and a wrapper around SQL execution records the database queries each request triggers. The data is stored in the configured database and shown in a built-in web UI at /silk/, where you can filter requests and see time taken, query count, query time, headers and bodies.
For deeper analysis, Silk can run Python's cProfile on each request and show the output in the UI, optionally with a call graph and a downloadable .prof file for tools like snakeviz. A decorator and context manager let you profile specific functions or blocks, and dynamic profiling can wrap functions in modules you cannot edit. Silk also generates curl and Python code to replay a recorded request.
Access can be restricted with Django authentication and permissions, and sensitive keys such as passwords and tokens are masked. Recording can be limited by percentage, status code or path, and old records can be garbage collected.
Key features
- 01Records requests, responses, headers and bodies through Django middleware.
- 02Tracks SQL queries per request, including execution time and stack traces.
- 03Runs cProfile per request and can produce call graphs and .prof downloads.
- 04Profiles specific functions or code blocks with a decorator or context manager.
- 05Generates curl and Python code to replay recorded requests.
- 06Supports authentication, permissions and masking of sensitive keys.
Use cases
- Finding N+1 query problems in a slow Django view.
- Profiling a specific function or block of business logic in development or staging.
- Investigating production errors by recording only requests with chosen status codes.
- Sharing a reproducible request as curl or a Python test snippet.
In collections
Topics
FAQ
- What is django-silk?
- A live profiler and inspection UI for Django that records requests, SQL queries and code blocks to help find slow spots. Silk is a profiling tool for Django applications. Its middleware intercepts each HTTP request and response, and a wrapper around SQL execution records the database queries each request triggers. The data is stored in the configured database and shown in a built-in web UI at /silk/, where you can filter requests and see time taken, query count, query time, headers and bodies.
- Is django-silk free to use? What license does it have?
- django-silk is open source under the MIT license. Check the license terms before using it in commercial products.
- Is django-silk still maintained?
- Actively maintained. The last commit to django-silk was on Nov 3, 2026.
- What can I use django-silk for?
- Finding N+1 query problems in a slow Django view. Profiling a specific function or block of business logic in development or staging. Investigating production errors by recording only requests with chosen status codes. Sharing a reproducible request as curl or a Python test snippet.
- Where can I get django-silk?
- The source code and installation instructions are on GitHub: https://github.com/jazzband/django-silk
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Continuous profiling platform that collects CPU, memory and I/O profiles from running applications so you can trace slow code down to individual lines.
A memory profiler for Python that tracks allocations in Python code, native extensions, and the interpreter, with several report types.
A command-line and web tool for visualizing and analyzing profiling data in the profile.proto format.
A low-overhead Python tracer that records function calls and visualizes code execution as an interactive timeline.
Line-by-line profiler for Python that shows how much time each source line of a decorated function takes.