Created
September 4, 2023 14:17
-
-
Save olivierphi/97dd87e298252a68d6cc6261166fb895 to your computer and use it in GitHub Desktop.
log SQL queries in a Django shell
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
import logging; db_logger = logging.getLogger("django.db.backends"); db_logger.addHandler(logging.StreamHandler()); db_logger.setLevel(logging.DEBUG) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment