Skip to content

Instantly share code, notes, and snippets.

@antunesleo
Created September 24, 2021 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antunesleo/7579d7c8e00c729cab5c50728a4461a7 to your computer and use it in GitHub Desktop.
Save antunesleo/7579d7c8e00c729cab5c50728a4461a7 to your computer and use it in GitHub Desktop.
import logging
from django.db import connection
connection.force_debug_cursor = True
l = logging.getLogger('django.db.backends')
l.setLevel(logging.DEBUG)
l.addHandler(logging.StreamHandler())
my_model = MyModel.objects.get()
# you should see the SQL on you terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment