DatabaseError: current transaction is aborted, commands ignored until end of transaction block

If you use Django with PostgresSQL, you might have encountered such an error before. In my experience, it is due to the following:

    1. You were messing around in shell and tripped it. To resolve this, see this answer:
    2. You made changes to your models which you’ve forgotten to run ./ schemamigrate <app_name> –auto and ./ migrate <app_name>. Conversely, you could try ./ syncdb
    3. Failing which, you can look in the logs of your postgres. For me the path is /usr/local/var/postgres/server.log. Look for the offending SQL entry and delete that record from your test database (it is a test database right?)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s