Skip to content

Instantly share code, notes, and snippets.

View debashisdeb's full-sized avatar

Debashis Deb debashisdeb

View GitHub Profile
@debashisdeb
debashisdeb / debug_stuff.py
Last active March 13, 2023 15:58 — forked from dhrrgn/debug_stuff.py
A handy SQL debug function for Flask-SQLAlchemy
from . import app
from flask.sqlalchemy import get_debug_queries
if app.debug:
app.after_request(sql_debug)
def sql_debug(response):
queries = list(get_debug_queries())
query_str = ''