Skip to main content

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.

Metadata

Release files for django-qc 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-qc 1.0.1
File Size Uploaded
django-qc-1.0.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-qc 1.0.1
File Interpreter ABI Platform
django_qc-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / django-qc-1.0.1.tar.gz

Download URL django-qc-1.0.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
83fa35007ce9a1ccd65ca059acc361996103e860f369088df0417764b1a6c8bc
BLAKE2b-256 checksum
How to use checksums
83dfae2db46086adbced14441dccaf93f20640f25632c17463f59729ad773a8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1023-azure

Release files / django_qc-1.0.1-py3-none-any.whl

Download URL django_qc-1.0.1-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6478bc7eb3fd9c105513cdd6c25e3878261ba248cde523104d6e2e75cf46b913
BLAKE2b-256 checksum
How to use checksums
eb5ff5b01706161ef9683d0b58146f2e1f4b6e8c08f91230f8c1507c994448c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1023-azure

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page