If you'd like to get down to the nitty-gritty details of the exception, then you can write a custom middleware class to wrap view processing and catch the unhandled django.db.DatabaseError
and inspect the exception in a debug session from your development server's console:
from django.db import DatabaseError
class DatabaseErrorMiddleware(object):
def process_view(self, request, view, args, kwargs):
try:
view(request, *args, **kwargs)
except DatabaseError as err:
import pdb; pdb.set_trace()
# You can now fully inspect the `e` exception object and it's context
These exceptions are benign and usually occur whenever a thread's request-response flow prematurely ends, quite often during development if your client aborts the connection before the application could return a response, though that might not be all of it.