Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miki725/django-debug-toolbar-alchemy
Django Debug Toolbar panel for SQLAlchemy.
https://github.com/miki725/django-debug-toolbar-alchemy
debugging-tool django sqlalchemy
Last synced: 9 days ago
JSON representation
Django Debug Toolbar panel for SQLAlchemy.
- Host: GitHub
- URL: https://github.com/miki725/django-debug-toolbar-alchemy
- Owner: miki725
- License: other
- Created: 2017-11-05T03:59:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-09T18:05:51.000Z (over 5 years ago)
- Last Synced: 2024-12-16T11:53:59.218Z (12 days ago)
- Topics: debugging-tool, django, sqlalchemy
- Language: Python
- Size: 26.4 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
============================
Django Debug Toolbar Alchemy
============================.. image:: https://badge.fury.io/py/django-debug-toolbar-alchemy.svg
:target: http://badge.fury.io/py/django-debug-toolbar-alchemyDjango Debug Toolbar panel for SQLAlchemy.
* Free software: MIT license
* GitHub: https://github.com/miki725/django-debug-toolbar-alchemyOverview
--------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': '',
}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,
}