I used to know how to do this, but I forgot. Sometimes, while using the Django shell, you make a mistake and cause the transaction to become aborted. After that, any further queries you do will result in DatabaseError: current transaction is aborted, commands ignored until end of transaction block. However, I think there is a way to rollback the transaction when this happens manually so you don't have to restart your session. Can anyone tell me what it is?

This bug report (https://code.djangoproject.com/ticket/10813) makes reference to the technique but doesn't explain it. Running django.db.transaction.rollback results in "TransactionManagementError: This code isn't under transaction management".

Edit
Report