unsupported operand type(s) for %: 'NoneType' and 'WSGIRequest'