DB utility to help you catch query inefficiencies in Django.
Project description
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.
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
Built Distribution
File details
Details for the file django-qc-1.0.1.tar.gz
.
File metadata
- Download URL: django-qc-1.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83fa35007ce9a1ccd65ca059acc361996103e860f369088df0417764b1a6c8bc |
|
MD5 | cb35962df43999e818b9561d00a1202e |
|
BLAKE2b-256 | 83dfae2db46086adbced14441dccaf93f20640f25632c17463f59729ad773a8d |
File details
Details for the file django_qc-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: django_qc-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6478bc7eb3fd9c105513cdd6c25e3878261ba248cde523104d6e2e75cf46b913 |
|
MD5 | 0e0c2503408ee1faf6385ebe3e9052f7 |
|
BLAKE2b-256 | eb5ff5b01706161ef9683d0b58146f2e1f4b6e8c08f91230f8c1507c994448c2 |