GitHub Actions GitHub Actions PyPI Download PyPI Python Versions Supported Django versions Jazzband

Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before presenting them in a user interface for further inspection:



Silk has been tested with:

  • Django: 2.2, 3.0, 3.1
  • Python: 3.6, 3.7, 3.8, 3.9


Via pip into a virtualenv:

pip install django-silk

In add the following:



Note: The middleware placement is sensitive. If the middleware before silk.middleware.SilkyMiddleware returns from process_request then SilkyMiddleware will never get the chance to execute. Therefore you must ensure that any middleware placed before never returns anything from process_request. See the django docs for more information on this.

Note: If you are using django.middleware.gzip.GZipMiddleware, place that before silk.middleware.SilkyMiddleware, otherwise you will get an encoding error.

If you want to use custom middleware, for example you developed the subclass of silk.middleware.SilkyMiddleware, so you can use this combination of settings:

# Specify the path where is the custom middleware placed

# Use this variable in list of middleware

To enable access to the user interface add the following to your

urlpatterns += [url(r'^silk/', include('silk.urls', namespace='silk'))]

before running migrate:

python makemigrations

python migrate

python collectstatic

Silk will automatically begin interception of requests and you can proceed to add profiling if required. The UI can be reached at /silk/

Alternative Installation

Via github tags:

<div class="highlight highlight-source-shell position-relative" data-snippet-clipboard-copy-content="pip install

pip install<version>.tar.gz