fix django upgrade to 1.5 issues