Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
Created April 22, 2020 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barseghyanartur/48b17001e07346d453c3223fb254e9b6 to your computer and use it in GitHub Desktop.
Save barseghyanartur/48b17001e07346d453c3223fb254e9b6 to your computer and use it in GitHub Desktop.
Patch logging for django.db on the fly from terminal

Patch:

import logging
logger = logging.getLogger('django.db')
logger.level = logging.DEBUG

Now we can:

from django.contrib.auth.models import User
User.objects.all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment