Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save earlbread/974c1de409fefc92b37ddf836761875a to your computer and use it in GitHub Desktop.

Select an option

Save earlbread/974c1de409fefc92b37ddf836761875a to your computer and use it in GitHub Desktop.
# To get all sql queries sent by Django from py shell
# https://stackoverflow.com/a/13106296
import logging
l = logging.getLogger('django.db.backends')
l.setLevel(logging.DEBUG)
l.addHandler(logging.StreamHandler())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment