Skip to main content

Django Debug Toolbar Alchemy

https://badge.fury.io/py/django-debug-toolbar-alchemy.svg

Django Debug Toolbar panel for SQLAlchemy.

Overview

This package completely mimics default Django Debug Toolbar SQL panel (internally its actually subclassed) but instead of displaying queries done via Django ORM, SQLAlchemy generated queries are displayed. Rest of the functionality is the same.

Installing

First install:

$ pip install django-debug-toolbar-alchemy

Then in your settings:

# settings.py
DEBUG_TOOLBAR_PANELS = [
    # other panels
    'debug_toolbar_alchemy.panels.sql.SQLPanel',
    # other panels
]

In order to support multiple DB databases, alias getter callable must be specified in settings:

# settings.py
DEBUG_TOOLBAR_CONFIG = {
    'ALCHEMY_DB_ALIASES': '<dot patht to alias getter>',
}

Alias getter must return a dictionary of aliases as keys and SQLAlchemy engines as values. If your application uses global session, you can get the engine from session instances:

from myapp.db import session, session_slave

def alchemy_dbs():
    return {
        'default': session.bind,
        'slave': session_slave.bind,
    }

History

0.1.2 (2018-08-30)

  • Fix bug by attaching SQLAlchemy events at most once. Otherwise in some cases when multiple threads are used, event handlers deque would be mutated while other SQLAlchemy events are running since event handling is not thread-safe in SQA.

0.1.1 (2018-07-13)

  • Fix bug which did not correctly track plain string clauses.

0.1.0 (2017-10-04)

  • First release on PyPI.

Credits

Development Lead

Contributors

  • None yet. Why not be the first?

License

The MIT License (MIT)

Copyright (c) 2017, Miroslav Shubernetskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Metadata

Release files for django-debug-toolbar-alchemy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-debug-toolbar-alchemy 0.1.2
File Size Uploaded
django-debug-toolbar-alchemy-0.1.2.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-debug-toolbar-alchemy 0.1.2
File Interpreter ABI Platform
django_debug_toolbar_alchemy-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.0 kB

Release files / django-debug-toolbar-alchemy-0.1.2.tar.gz

Download URL django-debug-toolbar-alchemy-0.1.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9f98d668a69a4de8402b7c9bd4b007cd5c893371833cc7ad7bbb84c3b5fb5016
BLAKE2b-256 checksum
How to use checksums
2aaa5ff6158d2d6f4d72b12ff89fc57af81521c3a0a4973751fc2db1062faa34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release files / django_debug_toolbar_alchemy-0.1.2-py2.py3-none-any.whl

Download URL django_debug_toolbar_alchemy-0.1.2-py2.py3-none-any.whl
Size 6.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d9da02e22dec2c06c55ced7bc872bde70fd451ec1afc699e9207d485f582b8b8
BLAKE2b-256 checksum
How to use checksums
58176b4d7749d4270c948854ebfc9ecf7e29ac7fe2e342c0d0e58a56e9b868c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page