skillfed

django-silk

Silky smooth profiling for the Django Framework

django-silk v5.5.2 2.6M downloads/30d#2,977 on PyPI4,991
Permissive license MIT License Active released

What it is and what it does

Silk is a live profiling and inspection tool built as Django middleware that automatically intercepts HTTP requests, responses, and database queries, storing them in the configured database for later inspection. It provides a web UI to explore request metadata (timing, query counts, headers, bodies), SQL execution details, and optional Python cProfile output with graph visualization via gprof2dot. Developers can also manually profile specific code blocks or functions using decorators or context managers.

The package depends on Django, sqlparse for SQL parsing, and gprof2dot for profiler graph generation. It supports Django 4.2 through 6.0 and Python 3.10–3.15. Configuration is straightforward—add the middleware and app to settings, include URLs, run migrations, and the UI becomes available. Middleware ordering matters: GZipMiddleware must precede Silk's middleware to avoid encoding issues, and any middleware before Silk that returns early will prevent profiling.

Use it for:

  • Identify slow database queries and N+1 problems by inspecting SQL execution within individual requests.
  • Profile view functions and code blocks to find performance bottlenecks using cProfile integration and decorator-based profiling.
  • Debug request/response issues by examining headers, bodies, and timing data through the web UI without code changes.
  • Analyze which endpoints generate the most queries or consume the most time during development and testing.
  • Generate downloadable .prof files for deeper analysis with tools like snakeviz or other cProfile utilities.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Silk intercepts and profiles HTTP requests, database queries, and code execution in Django applications, displaying results in a web UI for inspection and analysis.

Yes. Silk is a mature, actively maintained profiling tool with low install friction and no known vulnerabilities. It integrates seamlessly into Django projects via middleware and provides both automatic request profiling and manual code profiling. Ideal for development and staging environments to diagnose performance issues; production use requires careful configuration to limit data retention and avoid overhead.

Install

django-silk on PyPI

pip

pip install django-silk

uv

uv add django-silk

poetry

poetry add django-silk

Installing django-silk

Before you install

Low friction installation with three runtime dependencies. Active maintenance with recent commits and a stable production status across Django 4.2 through 6.0 and Python 3.10–3.15.

License in practice

MIT License permits unrestricted use, modification, and distribution in both open-source and proprietary projects.

Quickstart

pip install django-silk

# In settings.py:
MIDDLEWARE = [..., 'silk.middleware.SilkyMiddleware', ...]
INSTALLED_APPS = (..., 'silk')

# In urls.py:
urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))]

# Then: python manage.py migrate && python manage.py collectstatic
# Access UI at /silk/

Middleware order is sensitive; GZipMiddleware must be placed before SilkyMiddleware to avoid encoding errors. Python 3.10+ required.

Verify before relying

  • Whether cProfile concurrency limitation on Python 3.12+ significantly impacts real-world profiling workflows.
  • Performance overhead of request/response interception in high-traffic production environments.

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — Django, sqlparse, gprof2dot
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 2,593,281/month — #2,977 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_silk-5.5.2-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic Content

Tags

django request profilingdjango query inspectordjango performance monitoringdjango middleware profilerdjango sql query analysisdjango request response inspectiondjango cprofile integration
django-profilingperformance-debuggingrequest-inspection

More WWW/HTTP packages