Django SQL Middleware
A simple middleware aimed to capture all queries in a request and provide basic SQL profiling such as execution time, execution plan, and query traceback.
This package is only intended to run in development mode.
How To Install
-
Get the package from pypi:
pip install django-sql-middleware -
In
settings.pyadd:INSTALLED_APPS = [ # your other apps "sqlmiddleware" ] MIDDLEWARE = [ # your other middlewares ] if DEBUG: MIDDLEWARE.append("sqlmiddleware.middlewares.LogSQLMiddleware") -
Register urls in
your_project/urls.py:from django.urls import include, path urlpatterns = [ # other urls, path("__sql", include("sqlmiddleware.urls")), ] -
Run
collectstaticto serve included css and js assets:./manage.py collectstatic -
Start the development server:
./manage.py runserver -
you should be able to access
localhost:8000/__sqlin your browser.
Metadata
Release files for django-sql-middleware 0.0.3
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-sql-middleware-0.0.3.tar.gz | 106.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_sql_middleware-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 217.5 kB
Release files / django-sql-middleware-0.0.3.tar.gz
| Download URL | django-sql-middleware-0.0.3.tar.gz |
|---|---|
| Size | 106.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0933595795500c7743901370c5b41ff3fabb1c1fc23f9b831fab06bbba36656
|
|
BLAKE2b-256 checksum How to use checksums |
3b7358aab6b0a4b88a5e73a7e04c927849bdd917d7ee01a6a808b845ecde4e0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|
Release files / django_sql_middleware-0.0.3-py3-none-any.whl
| Download URL | django_sql_middleware-0.0.3-py3-none-any.whl |
|---|---|
| Size | 111.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e2e3491215ae17cbf1ab8b7ec5624e9f837f9f5ad0f23622a1bb5f96765430a
|
|
BLAKE2b-256 checksum How to use checksums |
d9048a820f2498526daaba1b4aa7dd0956bf7ba2c9770cb494b95a21fde1db9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|