The CLI command `-sql-truncate` cannot set NOT TRUNCATE

Author: sshishovCreated Jun 9, 2025Updated Dec 4, 2025

Hi dear maintainers,

I was trying to setup everything using CLI options and found out that there is no possibility to set the option to "NOT TRUNCATE" as the 0 value mentioned in the documentation will not work as it will be reset later on.

To properly support this situation, we have to have some UNSET state for the option/configuration to know if it was set or not...

To reproduce, just run shell_plus --sql-truncate=0 --print-sql and the SQL will be truncated.

This is the initial PR where his CLI option was added and where this issue appeared: https://github.com/django-extensions/django-extensions/issues/1686

Best regards, Sergei

Source: django-extensions/django-extensions