def get_response(filepath, encoding='utf-8'): body = open(filepath, 'r').read() response = HtmlResponse('test', encoding=encoding) response.body = body return response