fix mediagenerator on django==1.5