Created
October 28, 2012 04:09
-
-
Save pixyj/3967466 to your computer and use it in GitHub Desktop.
Log Sql queries in Django
This file contains 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
#To get all sql queries sent by Django from py shell | |
import logging | |
l = logging.getLogger('django.db.backends') | |
l.setLevel(logging.DEBUG) | |
l.addHandler(logging.StreamHandler()) | |
#For more info, http://stackoverflow.com/questions/971667/django-orm-how-to-view-or-log-the-executed-query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment