Created
September 24, 2021 18:14
-
-
Save antunesleo/7579d7c8e00c729cab5c50728a4461a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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