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 for non-sqlite database.
Currently, this package only tested in projects that uses psycopg2 (postgres) as default database engine.
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.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-sql-middleware-0.0.7.tar.gz | 106.6 kB | Without provenance | Details for django-sql-middleware-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_sql_middleware-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for django_sql_middleware-0.0.7-py3-none-any.whl |
Total release size: 217.8 kB
Release files / django-sql-middleware-0.0.7.tar.gz
| Download URL | django-sql-middleware-0.0.7.tar.gz |
|---|---|
| Size | 106.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
884cb3c2ff44d6fc26494655d3bb24859a04c6b15f56a03b4498b2d950547075
|
|
BLAKE2b-256 checksum How to use checksums |
9118fddfd79e24fab330c66c7786e061c12bccd7b2615d88f82d29e5cc7eaaa5
|
| 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.7-py3-none-any.whl
| Download URL | django_sql_middleware-0.0.7-py3-none-any.whl |
|---|---|
| Size | 111.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a10d849122694ddedb35f9b8cdd2e1755453626836b4863ee181bd90e2b4c564
|
|
BLAKE2b-256 checksum How to use checksums |
e1d8688f1622d5e86215b0b3161dbde179a2bf784d605723d2ff8304ceeabb9d
|
| 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
|
Security for django-sql-middleware 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.