Quickly setup SQL query logging on console in Django

There is need plugin for Django, named django-debug-toolbar but it needs some time to configure. So when I need simple way to debug SQL queries I use small hack. Add to your settings.py: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console': { 'level': 'DEBUG', 'class': 'logging.StreamHandler', } }, 'loggers': { 'django.db.backends': { 'handlers': ['console'], 'level': 'DEBUG', }, } } To get this working DEBUG option have to be set to True:...

2014-05-28 · 1 min

Sprawdzanie zainstalowanej wersji Django

Ten one liner załatwia sprawę: python -c 'import django; print ".".join([str(s) for s in django.VERSION]);'

2013-09-16 · 1 min