Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

DB utility to help you catch query inefficiencies in Django.

Project description

https://pypi.org/project/django-qc/ https://pypi.org/project/django-qc/ https://pypi.python.org/pypi/django-qc https://codecov.io/gh/sondrelg/django-query-counter https://pypi.org/project/django-qc/ https://github.com/pre-commit/pre-commit

Django query counter - simple query debugging

Lets you easily catch and fix database query inefficiencies during development by decorating any function or method.

Query counter

The main potential drawback of seeing query data in your code is that commits can become cluttered. We therefore recommend pairing django-qc with a pre-commit hook for removing the comments before they are ever even committed.

Installation

Install using pip:

pip install django-qc

Usage

Simply import the db_helper wrapper and pass verbose=True if you want more details than in the default setting.

from django_qc import db_helper

@db_helper(verbose=True)
def my_function():
    ...

Settings

There's only one setting to configure, but it is required:

DB_HELPER {
    'DEBUG': DEBUG
}

Decorator functions will not do anything if debug is False, and by design does not allow a debug value of True if the general Django debug value is False, as this is intended as a development aid only.

Project details


Download files

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

Files for django-qc, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size django_qc-1.0.1-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-qc-1.0.1.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page