Django+Postgres: “current transaction is aborted, commands ignored until end of transaction block”

后端 未结 9 1487
暖寄归人
暖寄归人 2020-12-12 11:39

I\'ve started working on a Django/Postgres site. Sometimes I work in manage.py shell, and accidentally do some DB action that results in an error. Then I am una

9条回答
  •  情歌与酒
    2020-12-12 12:06

    You can try this:

    from django.db import connection
    connection._rollback()
    

    The more detailed discussion of This issue can be found here

提交回复
热议问题