Skip to main content

Pretty print Django's SQL statments

Project description

Middleware that pretty prints Django’s sql statements.


Install from PyPI:

pip install django-sqlprint-middleware

then add it to the MIDDLEWARE settings in your file:


(Use MIDDLEWARE_CLASSES in older Djangos.)

This middleware is not order sensitive so you can put it at any position in the list of classes.


The following settings control the behavior (all of these have defaults).


Either of these need to be True for the middleware to run.


Set to False to skip middleware without removing it.


Set to false to prevent db hits being sent in the response header ‘X-DB-hits’


Raise an exception if the number of queries for a view is greater than this. Default is 1200 (zero means no check).


For less output you can set this to the number of queries a view can make before queries are printed (default is zero).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-sqlprint-middleware-0.1.4.tar.gz (2.8 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page