Added Django history db error handler