Tag Archives: django

Django enable SQL debug logging in shell how to

How to get Django to show debug SQL logging output in the shell. Works in Django 1.10! Start the Django shell: python manage.py shell Paste this into your shell: import logging log = logging.getLogger(‘django.db.backends’) log.setLevel(logging.DEBUG) log.addHandler(logging.StreamHandler()) The last line log.addHandler(logging.StreamHandler()) … Continue reading

Posted in Code | Tagged | Comments Off on Django enable SQL debug logging in shell how to