Added django transaction layer, fixed formatting