A simple Django middleware to log SQL queries during development.
Project description
Django Query Profiler
A simple Django middleware to log SQL queries executed during a request. This middleware is active only when DEBUG = True.
Installation
pip install bear-django-query-profiler
Usage
-
Add the middleware to your
MIDDLEWARElist insettings.py. It should be placed after any other middleware that might generate queries.# settings.py MIDDLEWARE = [ # ... other middleware 'query_profiler.middleware.QueryProfilerMiddleware', ]
-
(Optional) You can specify a list of string patterns to ignore in the logs. Any query containing one of these patterns will not be logged.
# settings.py QUERY_PROFILER_IGNORE_PATTERNS = ['global_system_logs', 'django_session']
-
Ensure your logging is configured to display
DEBUGlevel messages.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bear_django_query_profiler-0.1.0.tar.gz.
File metadata
- Download URL: bear_django_query_profiler-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1747bd624fca7f1c6067664923c42188d3997afa2a623acee2450c937c22cf2
|
|
| MD5 |
0d595335283943b0c7e7b1c268d71fe1
|
|
| BLAKE2b-256 |
235feca1a98466feb17e4e2b388ff1d8c358a2ad21eda1be1e55d49feed6983f
|
File details
Details for the file bear_django_query_profiler-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bear_django_query_profiler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee660d92f201d58ce8e3aa979a355edae14cbb7b06abfc3729e5efd1674d642c
|
|
| MD5 |
12c06309e0b97dd7a27b30864125f2c5
|
|
| BLAKE2b-256 |
aaf44c5516e1197b48c3e3bd409ef95256aa99f2de313d317501d53f11da6d44
|