sqlparse and Django ¶ See also https://github.com/andialbrecht/sqlparse Example 1 ¶ import sqlparse sql_query = sqlparse.format(str(liste.query), reindent=True) logger.info(f"\n{current_day=}\nSQL query:\n{sql_query}\n")