The Django wrappers for database exceptions behave exactly the same as the underlying database exceptions. See PEP 249, the Python Database API Specification v2.0, for further information.https://docs.djangoproject.com/en/3.1/ref/exceptio...
As per PEP 3134, a __cause__ attribute is set with the original (underlying) database exception, allowing access to any additional information provided.