debug/

Log quires in dnsmasq

Add the following line to dnsmasq configuration file:

log-queries
| 1 Jan 2019

Show raw SQL queries in PostgreSQL

If you want to inspect what queries exactly Django ORM sends to the PostgreSQL, you can do it with postgres logging. The first step is to enable logging. Add

log_statement = 'all'

to the file:

sudo vim /etc/postgresql/9.4/main/postgresql.conf

Then you are able to see raw SQL queries with command:

sudo tail -f /var/log/postgresql/postgresql-9.4-main.log
| 1 Jan 2017