Our Django integration lets you instrument individual HTTP requests by adding the dedicated middleware to your application. Please note that the Blackfire middleware supports Django 1.1 and higher.
Blackfire Django middleware has compatibility issues with the Django debug toolbar. You may consider disabling the Django debug middleware when using Blackfire.
DjangoMiddleware to your
MIDDLEWARE list in your Django
settings. This middleware is present in the
blackfire package when you
install Blackfire for Python.
1 2 3 4 5
MIDDLEWARE = [ # ... 'blackfire.middleware.DjangoMiddleware' # ... ]
Then, restart your server.
The order of
MIDDLEWARE is important. You should include the Blackfire
middleware as early as possible in the list. However, it must come after
any other middleware that encodes the response’s content, such as
You can use the
blackfire curl command to profile specific requests on
blackfire curl http://localhost:8000/polls/1/results