Django query counter - simple query debugging
Lets you easily catch and fix database query inefficiencies during development by decorating any function or method.
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)
| File | Size | Uploaded | |
|---|---|---|---|
| django-qc-1.0.1.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|