3👍
✅
When in debug-mode you could use the django.db.backends
logger.
https://docs.djangoproject.com/en/1.8/topics/logging/#django-db-backends
In production I would use loggers for PostGres itself, because saving these queries from within a Django process will (probably) have major impact on your performance.
Source:stackexchange.com